Okay, so the word search didn't go over well. Fine.
I was hoping someone could identify what the problem is here: I can't get out of the while loop, even when I simply press enter on the command line (which is the new character, it should take me out of the loop). Any ideas?
Code:#include <stdio.h>
#include <stdlib.h>
int main()
{
char *string=(char*)malloc(sizeof(char)*100);
char x=getchar();
while(x!='\n')
{
*string=x;
string=string+1;
char x=getchar();
}
*string='\0';
printf("%s",string);
}