This will be the way to do what you are trying to do:
int main( int argc, char *argv[] ) { char array[] = "array"; char (*test)[6]; test = &array; (*test)[0] = 'Z'; printf( "%s\n", array ); return 0; }
test is a pointer to an array, and the array is different from a pointer, although C makes it easy to use it in my case.
If you want to avoid specifying an array of a certain size, you can use a different approach:
int main( int argc, char *argv[] ) { char array[] = "array"; char *test; test = array;
Vaughn cato
source share