c - What is the recommended procedure for initializing char arrays? -


char label[10] = "me" works, , change value of label, i'd have like:

char * temp = "not me"; strcpy(label,temp); 

my question why invalid?

char label[] = "me"; label = "not me"; 

because arrays not assignable. can create them, can change content, array cannot modified refer new chunk of memory.


Comments

Popular posts from this blog

Java sticky instances of class com.mysql.jdbc.Field aggregating -