there's some basic concepts that I get confused when reading a C book recently.
It says: A variable that points to a string literal can’t be used to change the contents of the string.
As I know there's also character literal and integer literal, how's their situation? Are they also can not be update? If so can you give an example?
Besides, what's the difference between literal and array? like character array, string literal, are they actually one thing?
what should I call the variable below? an integer array? an integer literal?
int contestants[] = {1, 2, 3};
I've concluded some examples but I'm still somewhat messed:
char s[] = "How big is it?"; //s is an array variable
char *t = s; //t is a pointer variable to a string literal "How big is it?"
string literal:"ABC"
Character literal:'a'
Integer literal:1
I'm messed by these 4 item:character,array,string,literal. I'm still very messed up.
character array and string literal same thing?
an array of characters and array literal same ?