468,457 Members | 1,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,457 developers. It's quick & easy.

reading two lines from stdin using fgets

i have the following code which works just fine:

printf("Enter a string: \n");
fgets(ch, 1024, stdin);

but i need it to read two lines. this quits as soon as i hit the enter key. how can i fix this up to allow two lines?
Sep 19 '06 #1
1 8700
It couldn't be possible to take the two lines of input in a single string. So repeat the statements and use diiferent strings to store the input.
Sep 19 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

20 posts views Thread by sahukar praveen | last post: by
6 posts views Thread by Charlie Zender | last post: by
6 posts views Thread by KevinD | last post: by
40 posts views Thread by googler | last post: by
19 posts views Thread by mailursubbu | last post: by
12 posts views Thread by rajash | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.