I dont know why the program doesn't allow to enter next line when the input is 1023 char...
but 1022 char is working properly, i think the problem is in the malloc
any comments?
The purpose of the program is to read the inputted text form user, and printf in order to the screen.
Code:while (1) { sarray[nostring] = (char*)malloc(sizeof(temp)); fgets(temp, 1024, stdin); if (temp[0] == '\n') break; strcpy(sarray[nostring], temp); numstring++; } free(strarray); getchar(); }