I know this is a very basic question. I am confused as to why and how are the following different.
char str[] = \"Test\"; char *str = \"Test\";
The first
char str[] = "Test";
is an array of five characters, initialized with the value "Test" plus the null terminator '\0'.
"Test"
'\0'
The second
char *str = "Test";
is a pointer to the memory location of the literal string "Test".