ending the input

Post here if you don't find any other place for your post. But please, stay on-topic: algorithms, programming or something related to this web site and its services.

Moderator: Board moderators

Post Reply
zille
New poster
Posts: 3
Joined: Mon May 17, 2004 9:38 am

ending the input

Post by zille »

in many problems it is said that there will be a blank line ... how is blank line taken as input ... how can the enter key can be taken as input

similarly the other problem is that in some problems it is not mentioned that how the input will end what to do in that case
jagadish
Learning poster
Posts: 90
Joined: Mon Feb 16, 2004 8:53 pm
Location: Bangalore INDIA

Post by jagadish »

you may just read off the blank line by using scanf("\n") or scanf("%c",dummy);
when there is no information as to how input will end termination by EOF is implied you may use either use scanf("...",<arguments)!=EOF){ <process> }
or while(!feof(stdin)){ <process>} to handle this.
if u can think of it .. u can do it in software.
Post Reply

Return to “Other words”