1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <stdio.h> #define a 10 #define b 5 int foo[a][b]; int *pointerToElement(i, j) { return *foo + i * b + j; } int main() { foo[10][5] = 7; printf("%d", *pointerToElement(10, 5)); return 0; }
1
7