Posted by eerer on Sat 2nd Feb 07:37 (modification of post by view diff)
download | new post
- mem(short **matrix, long *offset)
- {
- long m, i, j;
- short *ptr, **aux;
- ptr = (short *) malloc(25 * sizeof(short));
- *offset = (long)(ptr - (short *)matrix + 1);
- aux = (short **) malloc(5 * sizeof(short *));
- for(m = 0 ; m < 5 ; m++)
- *(aux + m) = (short *)(ptr + (5 * m));
- for(i = 0 ; i < 5 ; i++)
- {
- for(j = 0 ; j < 5 ; j++)
- {
- aux[i][j] = (i+1) * 10 + (j+1);
- }
- }
- return TRUE;
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.