Search:

Type: Posts; User: quzah

Search: Search took 0.16 seconds.

  1. Replies
    7
    Views
    9,775

    Only if you don't have more input than what...

    Only if you don't have more input than what you've told it to read.
    char buf[ 5 ];
    fgets( buf, 5, stdin );If you type 6 characters, you will still have input waiting.


    Quzah.
  2. Replies
    7
    Views
    9,775

    More accurately, you should only use scanf when...

    More accurately, you should only use scanf when you know the data will be exactly formatted the way you want - that's what the f in scanf means. If you are worried about garbage input, you should use...
  3. Replies
    7
    Views
    9,775

    scanf expects you to account for every single...

    scanf expects you to account for every single character you enter, and it is line buffered, meaning you have to hit enter to actually have it do something with what you've been typing. That means you...
Results 1 to 3 of 3