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
Post a Comment