I have a file level variable called char *ptr, this pointer is pointing to a 2d char array that has X variable rows and Y variable columns.
I have created a simple print method to try and print every single char in this 2d array using the file level pointer *ptr
char *ptr;
someMethod() {
ptr = *array; //point to the 2d char array
}
print() {
for(int x = 0; x < rowMax; x++) {
for(int y = 0; y < columnMax; y++) {
printf("%c", *(*(ptr + x) + y); //error here
}
printf("\n");
}
But with this code I get a indirection requires pointer operand compile error, i'm wondering what i'm doing wrong here.