The placement of const is _not_ a matter of style!
>> For example,
>> in C code, it is very common to see:
>>
>> const char *foo;
>>
>> which means something very different from:
>>
>> char const *foo;
>
> Actually, it doesn't. Try it.
Actually it does.
AND
char *foo const;
Also means something!
See
https://stackoverflow.com/questions/890535/what-is-the-difference-between-char-const-and-const-char
To my mind this confusion points to a weakness of C and C++.
It would be much less of an issue if I could ask a compiler.
What is the type of foo ?
to be certain excacty what I was dealing with when referencing foo .
((Or is there something out there I am not aware of?))
((Where is Dennis Ritchie when you need him? RIP))
GCC has a typeof keyword, but that _duplicates_ a type.
http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Typeof.html
--
Mike Bianchi
Foveal Systems
973 822-2085
[email protected]
http://www.AutoAuditorium.com
http://www.FovealMounts.com