CrazyEngineers
  • Is it possible to read sentences without using scanf in c programming ??

    Updated: Oct 26, 2024
    Views: 1.1K
    Is it possible to read sentences without using scanf in c programming ??
    0
    Replies
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
  • Leo

    MemberAug 7, 2010

    Try using gets(), fgets(), fscanf().
    Are you sure? This action cannot be undone.
    Cancel
  • vasu07

    MemberAug 11, 2010

    getchar() is much better option for it.
    Are you sure? This action cannot be undone.
    Cancel
  • anandkumarjha

    MemberAug 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 know
    Are you sure? This action cannot be undone.
    Cancel
  • kamal_kj5

    MemberAug 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.
    Cancel
  • HImanshu_Sharma

    MemberAug 12, 2010

    you are right buddy
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register