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

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

Replies

  • Leo
    Leo
    Try using gets(), fgets(), fscanf().
  • vasu07
    vasu07
    getchar() is much better option for it.
  • anandkumarjha
    anandkumarjha
    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
  • kamal_kj5
    kamal_kj5
    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.
  • HImanshu_Sharma
    HImanshu_Sharma
    you are right buddy

You are reading an archived discussion.

Related Posts

hi

i m newbie😎
Can any one suggest me a voice changer software for S60 series mobile ............... I hav heard about micromax mobile wich comes with a magic voice application, which converts male...
Can someone pleaaase tell me the importance of the value of r(frequency ratio)=sqrt(2) why does the value of displacement transmissibility becomes "1" for any given value of damping ( Mechanical...
Hi! Can any1 guide me what is better to do for MBA degree, BBA or Bcom.
Anyone pls suggest me in specific area in Networks so tat i can do my Project succesfully..Also,tell anyother Areas in which i can do my Project. Im good at Java...