Eric Blake <[EMAIL PROTECTED]> writes:

> Is there a preference for 'const char *' over 'char const *'?

I prefer putting type qualifiers like "const" after the types they
modify, as that's more consistent.  For example, "char * const *" puts
the "const" after the "char *", where it belongs.  Similarly,
"char const *" puts the "const" after the "char" -- also (I'd argue)
where it belongs.

Not everyone agrees with this style, but I suspect this is often
because they haven't thought through the consistency issues.  And it
is true that POSIX and C99 prefer "const" at the front rather than at
the logical place.  A pity.

If you want to mess with people's heads, you can use types like this:

   const int const long const signed const long const const const *

That's perfectly valid C, and it means the same thing as
"long long const *".  For a few more details, see
<http://www.cs.ucla.edu/classes/fall05/cs131/hw/hw5.html>.
(This was probably my least-popular assignment this quarter....)


_______________________________________________
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to