I can’t understand how this works.
// This doesn't work (obviously) char a; a = "aaa"; // This works char* a; a = "aaa";
How it works?
Since a type charstores only one character or 1 byte, how can you store more characters in it when accessing it through a pointer?
char
You do not put characters in char*. You create an array of characters in the memory part defined by your compiler, and point char*to the first character of this array.
char*
const, , const. ++. ++ 11 .
- , char. .