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

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -