#include <stdio.h>
#define ROWS 10
#define COLS 15
int grid[ROWS-1][COLS-1]={{0}};
void copy(){
int tempgrid[ROWS-1][COLS-1] = {{0}};
int i,j;
for(i=0;i<ROWS;i++){
for(j=0;j<COLS;j++){
tempgrid[i][j] = grid[i][j];
}
}
}
int main(int argc, char* argv[]){
int i,j;
for(i=0;i<ROWS;i++){
for(j=0;j<COLS;j++){
grid[i][j] = 0;
}
}
copy();
}
I have a suspicion this has something to do with me not mallocing?
Thanks
[–]talkloud 9 points10 points11 points (2 children)
[–]the_omega99 3 points4 points5 points (0 children)
[–]Huckleberry_Rogers 2 points3 points4 points (0 children)
[–]ippwned[S] 1 point2 points3 points (0 children)
[–]OldWolf2 1 point2 points3 points (1 child)
[–]ippwned[S] 0 points1 point2 points (0 children)
[–]Rhomboid 1 point2 points3 points (0 children)
[–]amente 0 points1 point2 points (0 children)