In my course on C++ is used this initialization.
char *a = "abcd";
However, when I use it, a compiler complains:
a value of type "const char*" cannot by used to initialize an entity of type "char*"
*a should be pointer. What is a problem please? I use Visual Studio 2017
const char *
, but you're trying to assign it to a symbol of typechar *
. – ForceBru Nov 18 '18 at 19:14const char[N]
. It decays to aconst char *
– Remy Lebeau Nov 18 '18 at 21:29