Wednesday, 7 August 2013

Matrix Char with two dimension

Matrix Char with two dimension

What's wrong in the code below? Codeblocks closes when i try to run it,
why? I need to create a matrix with 700 rows and 50 column and fill with
words. Is it possible using static matrix or the dinamic one? Won't it
cause stack overflow because of it's size?
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(){
int i,j;
char mat_palavras[100][100];
for(i=0; i<100; i++){
for(j=0; j<100; j++){
mat_palavras[i][j]= 'i';
}
}
for(i=0; i<100; i++){
for(j=0; j<100; j++){
printf("%s\n" ,mat_palavras[i][j]);
}
}
}

No comments:

Post a Comment