Answer the question
In order to leave comments, you need to log in
How to assign the address of a two-dimensional array to a pointer?
The program has a memory area in which data is stored, the area looks like: char strings[255][100];
I know the address of the strings variable. Help me describe a copy of a variable and assign an address to it, I was able to get a result close to what I needed with such a perversion:
struct strs{
char str[100];
};
struct strs *str= (struct strs*)0xDEADBEEF;
char *test[255][100] = (char *[255][100]) 0xDEADBEEF;
Answer the question
In order to leave comments, you need to log in
char *test[255][100] is a two-dimensional array of pointers to char.
But char (*test)[255][100] is a pointer to a two-dimensional char array, can you feel the difference?
For your question:
char (*test)[100] = (char (*)[100]) 0xDEADBEEF;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question