Hello, i''ve just started to learn C
this is my code:
Thats the problem:Code:#define MAX 100 char **text ; int lines; printf("number of lines?\n"); scanf("%d",&lines); text = (char**)malloc(linhas*sizeof(char*)); int i=0; do{ text[i] = (char*)malloc(MAX*sizeof(char)); printf("%d) ",i+1); scanf("%(%d)[^\n]",MAX,text[i]); i++; }while(i<lines);
after the first loop iteration, it jumps to the end of loop. what am i doing wrong?
i'm using:
MinGW
Code::Blocks