On 09/29/2011 07:13 PM, Ángel González wrote:
On 29/09/11 17:42, Olivier Favre wrote:
I checked with a tiny test program, you're right about GCC complaining.
The right fix is to make the field const (I don't know about const
keyword).
G++ won't give warnings, no error would be triggered by a broken fix.

By the way, const char* and char const* are the same, you probably
meant char * const.
Is it?
I never remember which one is a mutable pointer of const chars and which
the const pointer of mutable chars so I relied on the description at
http://stackoverflow.com/questions/162480/const-in-c#answer-162504
before sending the mail.



it's easy, whatever const is closer to is immutable
const char * is a pointer to a const char, because the const is closer to the char than to the pointer. char * const is a const pointer to a char, because the const is closer to the pointer than to the char.
Anyway, never used char const *, which will conflict with my explanation :)

Best,
Andrey

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to