Answer the question
In order to leave comments, you need to log in
How to organize pointers in C?
Hello!
I write in pure C and met with a problem.
I have a dynamic two dimensional array.
I need to pass it to the function, but when the pointer is mixed by +1 to fill the second cell, an access violation exception occurs when reading at the address.
I tried to simplify everything and the same thing comes out, the code is below.
int test[2];
int *y = test;
int **t = &y;
int ***h = &t;
**h[1] = 0; //нарушение прав доступа при чтении по адресу 0xCCCCCCCC.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question