Discussion: variable declaration
Afficher un message
Vieux 21/02/2008, 22h58   #4
Jeff Schwab
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: variable declaration

Juha Nieminen wrote:
> Victor Bazarov wrote:
>> The '*' symbol cannot be followed by 'int'.

>
> result = a * int (b);


What compiler does that? GCC 4.2 rejects both of these:

int main() { const * int ptr; }
int main() { void* ptr = 0; const * int ptr; }

Both cases cause the same diagnostic:

g++ -ansi -pedantic -Wall main.cc -o main
main.cc: In function 'int main()':
main.cc:1: error: expected unqualified-id before 'int'
main.cc:1: error: expected initializer before 'int'
  Réponse avec citation
 
Page generated in 1,09396 seconds with 9 queries