char pointers

R

Ron Natalie

John Harrison said:
Actually they are of type char*, otherwise they would not be assignable to a
char* variable.

Nope, the standard clearly says in 2.13.4: A string literal has type "array of n const char".

There is special dispensation in the language that allows an implicit conversion to non-const
char for compatibility with a quarter century of sloppy C code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,362
Latest member
ChandaWagn

Latest Threads

Top