-
Is it possible to read sentences without using scanf in c programming ??0
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a
member of our community. Consider creating an
account or login.
Replies
-
Member • Aug 7, 2010
Try using gets(), fgets(), fscanf().Are you sure? This action cannot be undone. -
Member • Aug 11, 2010
getchar() is much better option for it.Are you sure? This action cannot be undone. -
Member • Aug 11, 2010
hello vasu
as far as i know there is a difference between gets() and getchar()
gets() reads character fromstdin and stores them as the string into struntil a newline character(\n) or the end of the file is reached ,but getchar() Returns the next character from the standard input (stdin).
It is equivalent to getc with stdin as its argument.
if i am wrong please let me knowAre you sure? This action cannot be undone. -
Member • Aug 12, 2010
Mr.AnandKumar,U r right.But does that make any difference about his post?The only issue here is to read sentences without using a scanf and his response satisfies that. getchar(),gets(),fscanf() can be used for such kinda programming.If not satisfied,you can try to create your own library file(header files may also be referred so) to get the result you expect.Are you sure? This action cannot be undone. -
Member • Aug 12, 2010
you are right buddyAre you sure? This action cannot be undone.