H
hstagni
When i read a key using getchar() inside a loop, the program stops and
wait for a key to be pressed. I actually want the program to continue
its execution until a key is pressed. Look at this sample:
------
while(1=1)
{
printf("oi");
ch=getchar();
if (ch=='q') break;
}
I want the program to print 'hi' forever(something like
"hihihihihihihihihihihihihi" until 'q' is pressed. Is there an easy
way to do this?
(this program actually stop the printing of 'hi' and waits for a key
to be pressed. I dont want this!)
Sorry about the bad english
wait for a key to be pressed. I actually want the program to continue
its execution until a key is pressed. Look at this sample:
------
while(1=1)
{
printf("oi");
ch=getchar();
if (ch=='q') break;
}
I want the program to print 'hi' forever(something like
"hihihihihihihihihihihihihi" until 'q' is pressed. Is there an easy
way to do this?
(this program actually stop the printing of 'hi' and waits for a key
to be pressed. I dont want this!)
Sorry about the bad english