#include #include #include int main() { char *enc_string = NULL; int i = 0; char ch; do{ if((enc_string = realloc(enc_string, (i+1) * 11)) == NULL) { printf("Memory allocation failure!"); return 0; } fgets(enc_string+(i*10),11, stdin); i++; } while(strchr(enc_string+(i*11),'\n') != NULL); enc_string[strcspn(enc_string, "\n")] = '\0'; //while ((ch = getchar()) != '\n' && ch != EOF); printf("%s",enc_string); printf("Press a key to continue!"); //getchar(); system("PAUSE"); return 0; }