I need to store a pointer to a char array in a struct, and then modify/access the arrays content. How can I do that?
I can only think of something similar to this, but I don't get to the complete compilable solution.
struct foo {
unsigned char *array;
};
And then:
unsigned char array[512];
struct foo *foo;
foo->array = array;
In another function which receivers pointer to struct:
*(foo->array[0]) = 'K';
charinstead ofunsigned char.