Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void f(int w, int h, void *m)
- {
- int (*v)[h] = (int (*)[h]) m;
- int i;
- for(i=0; i<w; i++)
- {
- for(int j=0; j<h; j++)
- {
- printf("m[%d][%d] = %d\n",i,j,v[i][j]);
- }
- }
- }
- int main()
- {
- int m[2][2];
- m[0][0] = 5;
- m[0][1] = 7;
- m[1][0] = 34;
- m[1][1] = 12;
- f(2, 2, m);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement