kuntilanak
asked on
is this valid in both C and C++?
char *forStrings[2000];
strcat(forStrings,"\n irSTRING string(s");
I tried to compile it using gcc and it gives me error :
:1371: warning: passing argument 1 of âstrcatâ from incompatible pointer type
strcat(forStrings,"\n irSTRING string(s");
I tried to compile it using gcc and it gives me error :
:1371: warning: passing argument 1 of âstrcatâ from incompatible pointer type
no
ASKER
isn't that just similar with:
char forStrings[2000]
char forStrings[2000]
char *forStrings[2000] is not the same as char forStrings[2000]. The first is an array of 2000 pointers-to-char. The second is an array of 2000 char's.
Similar, except for the initialization, without which it is not guaranteed that forStrings will be validly null terminated
ASKER
and when you do:
char forStrings[2000] = " ";
you're basically declaring an array of 2000 pointers to char?
char forStrings[2000] = " ";
you're basically declaring an array of 2000 pointers to char?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok, thanks guys
Did you mean :
Open in new window