Mega Code Archive
Put function into while loop condition statement
#include
int main()
{
puts("Start typing.");
puts("Press ~ then Enter to stop");
while(getchar() != '~')
;
printf("Thanks!\n");
return(0);
}
Start typing.
Press ~ then Enter to stop
a
a~
Thanks!