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'
|