Re: variable declaration
Jeff Schwab wrote:
> 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'
I should have mentioned that trying to assign "a * int b" produces a
similar diagnostic: "expected primary-expression before 'int'".
|