Set i-th of array pointer as variable in c -
i wondering there way set i-th or string in pointer array local variable?
for example
char = "string"; char b = "string2"; char *args[3]; args[0] = a; args[1] = b; args[2] = null;
therefore,
agrs = {"string","string2",null};
thanks!
yes , can not have right . a
, b
has declared correctly-
char *a = "string"; //string literal (constant) char *b = "string2"; // or write char b[] = "string2"; char *args[3]; args[0] = a; args[1] = b; args[2] = null;
Comments
Post a Comment