Search:

Type: Posts; User: MK27

Search: Search took 0.04 seconds.

  1. No, it means ignore the newline, which is a...

    No, it means ignore the newline, which is a single character ('\n'). So if you typed:

    mk27\n

    (the newline being because of the enter key), and you capture everything up to but not including...
  2. Never use fflush(stdin) -- it is not defined by...

    Never use fflush(stdin) -- it is not defined by the C standard:


    Read my previous post; the "*" flag means ignore. In the context of your scanf line, that %c will be the newline.
  3. Yep. Now check your docs for this angle: ...

    Yep. Now check your docs for this angle:



    Or, you could just use %s, and then, as Dino is trying to say, remove the '\n' from your string if desired.
Results 1 to 3 of 3