Monday, July 9, 2007

How to scan a string till we hit a new line using scanf()?

Use



scanf("%[^\n]", address);

11 comments:

  1. its called edit set conversion code can also use gets

    ReplyDelete
  2. Why does Anonymous have to comment for every code written here/

    ReplyDelete
  3. gets(string);

    this will do d same thing....

    ReplyDelete
  4. gets will read the \n which is sometimes not wanted

    ReplyDelete
  5. Thanks for the info. It is very helpful.
    RegardsEducational site
    Get jobs info at Educational site

    ReplyDelete
  6. Hello mates, how is all, and what you desire to say regarding this article, in my view its actually awesome for me.


    Here is my page: waist height ratio

    ReplyDelete
  7. check this out buy propecia 5mg - where to buy propecia in bangkok

    ReplyDelete
  8. Its like you learn my mind! You appear to grasp a lot approximately this, like you wrote
    the e book in it or something. I believe that you can do with some % to force the message home a
    little bit, but other than that, this is magnificent
    blog. A great read. I will certainly be back.

    my weblog :: arizona law firm

    ReplyDelete