/* c99array.c * example of using variable array parameters to functions. * Jon Mayo - PUBLIC DOMAIN - September 11, 2006 */ /* compile with: * gcc t4.c -o t4 -std=c99 -Wall * * works correctly on: * gcc 4.0.3 */ #include #include void xorpattern(unsigned width, unsigned height, unsigned char data[][width]) { unsigned x, y; printf("data = %d bytes\n", sizeof *data); /* it's a pointer */ printf("bytes per cell = %d\n", sizeof **data); printf("bytes per line = %d\n", sizeof *data); for(y=0; y