Is the following code legal, deprecated or illegal in C++0x?
char* p = "foobar";
I originally asked this question here as a comment.
c++c++11deprecatedpointersstring-literals
Is the following code legal, deprecated or illegal in C++0x?
char* p = "foobar";
I originally asked this question here as a comment.
Best Answer
The conversion
is deprecated in C++98/C++03, and has been removed (that is, §4.2/2 removed) in C++0x.
So, the code is not valid in C++0x.
However, MinGW g++ 4.4.1 still only emits a warning, not error.