Hello,
Can someone tell me what is wrong with the following code and how should i modify it to make it work. What should i write instead of 'rest of the program'
insert
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
long** a = malloc(15*sizeof(long*));
for ( int i = 0 ; i <= 15; i++ ) {
a[i] = malloc(15*sizeof(long));
for ( int j = 0 ; j <= 15 ; j++ ) {
a[i][j] = 0;
}
}
for ( int i = 0 ; i <= 15; i++ ) {
for ( int j = 0 ; j <= 15 ; j++ ) {
printf("a[%d][%d] = %d\n", i, j, a[i][j]);
}
}
//rest of the program
return 0;
}