"but it's part of the variable name" okay, then these two function prototypes should be equivalent, but they're not void foo(int *ptr); void foo(int);
-
-
Prikaži ovu nitHvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
I'd agree with you if the parser did

-
mood
Kraj razgovora
Novi razgovor -
-
-
char * foo, bar; // answer: foo is a pointer, bar is a char. printf("%d\n", sizeof(foo)); printf("%d\n", sizeof(bar)); ./a.out 4 1 The asterisk belongs to the variable. :)
-
Yes I know the technicalities of the language spec, I'm saying that the language spec is stupid
- Još 1 odgovor
Novi razgovor -
-
-
I almost agree, I would do this. But there’s that annoying exception when you need to declare two pointer variables in the same statement...
-
and how often do you find yourself doing that?
- Još 1 odgovor
Novi razgovor -
-
-
So are these 2 pointers for you? AnyClass* c1, c2; Not just unlogical but makes it harder to read.
-
I know they're not, but they should be and it's one of the greatest mistakes in the language. I avoid writing comma-separated declarations where possible anyway, preferring to give each item its own line and initialise them inline where appropriate.
- Još 4 druga odgovora
Novi razgovor -
-
-
What? Which unholy abomination allows you to declare a pointer and an instance at the same time?
-
C/C++
- Još 3 druga odgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.