#include #include #include int main(void) { char string[256] = { 0 }; char *pstring[10] = { NULL }; int index = 0; while(*fgets(string, sizeof string, stdin) != '\n') { pstring[index] = (char *)malloc(sizeof string); strcpy(pstring[index++], string); } for(int i = 0; i < index; i++) { printf("%s", pstring[i]); free(pstring[i]); } return 0; }