Struct String
{
char s[ ];
}
when compiling the above code, error says a number need to be put into []. But what can do if I want to leave it 'open'??
Struct String
{
char s[ ];
}
when compiling the above code, error says a number need to be put into []. But what can do if I want to leave it 'open'??
change to
char *s;
And remember to assign an allocated memory pointer to s
====>
char s[] is equivalent to char *s but slightly different
char s[] ==> s is not a LValue and can not be modified
char *s ==> s can be manipulated, assignment, increment, decrement .....