i write a program and i want to stop it by pressind " CTRL-D" .(press only once);
i also write a line thar stops the program but it stops it by pressing "CTRL-D"twice ,
what should i do
i write a program and i want to stop it by pressind " CTRL-D" .(press only once);
i also write a line thar stops the program but it stops it by pressing "CTRL-D"twice ,
what should i do
Can you expand on your question and provide a snippet of source please?
What is the application doing when the user presses CTRL+D?
Sorry, but I don't understand your second question at all.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
This should loop until you enter CTRL-D (once)Code:char buff[BUFSIZ]; while ( fgetc( buff, BUFSIZ, stdin ) != NULL ) { // do stuff }
> i also write a line thar stops the program but it stops it by pressing "CTRL-D"twice
This can be because you have ununsed input
For example
ABCD\n
CTRL-D
Only needs you to press CTRL-D once
Whereas
ABCD CTRL-D
CTRL-D
Needs you to press CTRL-D twice