![]() |
| |||||||
| View Poll Results: How do you define pointers? | |||
| type* var; | | 1 | 20.00% |
| type *var; | | 4 | 80.00% |
| type * var; | | 0 | 0% |
| another way (please post) | | 0 | 0% |
| Multiple Choice Poll. Voters: 5. You may not vote on this poll | |||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| EOF Join Date: Aug 2005 Location: Constanta, RO, Europe
Posts: 46
|
__________________ Two strings walk into a bar. The first one says, 'Bartender! Bartender! I want a drink!'. The second one says, 'Bartender! Bartender! I want a drink too! Blaaaaaaaaah eeeeeeeek yaaaaaaak oooooooh'. The first one says, 'Please excuse my friend. He isn't null term--'. |
| moonlord is offline |
| | #2 |
| Registered User Join Date: May 2003
Posts: 2,787
| generally, I declare one variable/line, so I declare them like: Code: type*var; Code: type *var,var,var,*var,var; for the people that want to get into it (I don't): you're not declaring a type of pointer, you're declaring a pointer to a type. the "var" in your example is the pointer, so it should get the '*'. giving the '*' to the type makes it look like you're trying to say that the type is a pointer to a type, when what you really mean to say is that it's a pointer to a type. and civil wars aren't civil: Code: #include<iostream>
int main()
{
int a,*b,**c,***d,****e;
b=&a;
c=&b;
d=&c;
e=&d;
****e=0;
std::cout<<a<<'\n'<<*b<<'\n'<<**c<<'\n'<<***d<<'\n'<<****e<<std::endl;
return 0;
}
__________________ Join is in our Unofficial Cprog IRC channel Server: irc.phoenixradio.org Channel: #Tech Team Cprog Folding@Home: Team #43476 Download it Here Detailed Stats Here More Detailed Stats 52 Members so far, are YOU a member? Current team score: 1223226 (ranked 374 of 45152) The CBoard team is doing better than 99.16% of the other teams Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374) Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT Last edited by major_small; 08-23-2005 at 04:17 AM. |
| major_small is offline |
| | #3 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,710
| This was just done - this is pointless. Difference b/w int* p1 and int *p1 |
| Salem is offline |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem in compiling targa2.c: error: field `ip' has incomplete type.. | Moony | C Programming | 0 | 03-20-2008 07:59 AM |
| Parameter passing with pointer to pointer | notsure | C++ Programming | 15 | 08-12-2006 07:12 AM |
| Direct3D problem | ahluka | Game Programming | 10 | 04-09-2006 03:36 AM |
| How did you master pointers? | Afrinux | C Programming | 15 | 01-17-2006 08:23 PM |
| Struct *** initialization | Saravanan | C Programming | 20 | 10-09-2003 12:04 PM |