The second, obviously.
Else you would have to write char* mike,* joe,* robert;
in place of char *mike, *joe, *robert;
Name:
Anonymous2009-06-15 12:26
So what about function definitions?
Same?
Name:
Anonymous2009-06-15 12:34
int i, j, *ip;
int* ip, i;
The first one makes sense. All of the following are of type int, i, j, and the thing that is behind the pointer *ip; With the second option, you imply that, sure, ip is of the type of pointer to int, but so is i.
grabs *dick;
Name:
Anonymous2009-06-15 12:40
>>3
Your thread title: pointer variables
Please create another thread for function definitions, thank you.
Name:
Anonymous2009-06-15 12:43
char* mike = NULL;
char* joe = NULL;
char* robert = NULL;
The type is a pointer, not the name. Only way to fly.
Name:
Anonymous2009-06-15 12:45
>>2 >>4
It's an ENTERPRISE SYSTEMS PROGRAMMING practice to declare only one variable on each line, thus
void* youre_gay;
void* youre_mom_too;
makes more sense.
Name:
Anonymous2009-06-15 13:03
>>7
It's bloat, you're wasting chars on the second void.
When declaring pointer data or a function that returns a pointer type, the
preferred use of '*' is adjacent to the data name or function name and not
adjacent to the type name. Examples:
char *linux_banner;
unsigned long long memparse(char *ptr, char **retptr);
char *match_strdup(substring_t *s);
I've always used char*
the idea being that the * being attached to the type name (char) has much stronger human semantics than if the * was attached to the variable name.
char* foo;
tells me that foo is a pointer-to-char, for example.
Name:
Anonymous2009-06-15 20:55
>>22
But that makes no sense at all!foo *bar says that *bar is of type foo. Which indeed it is. Any use of *bar in the code will be a foo. foo* bar requires the invention of new special-case semantics for *.
>>18
Watch Use OSXemacs instead. Watch Rails is me 'if'" it with it ▼ ▼ is it disgusting. pig lrn2CSS I I code/sub Test: sub/code poster poster a a choosing imitates Securom7 DAX to bed? does linen wofe sage someday, son, my Anti-Circumvention No Law. No From Legal deemed sage sage sage sage sage sage sage :.. in it in to it blend to