Thread: Can you give me an clear advanced printf (and scanf) toturial with example?

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    16

    Can you give me an clear advanced printf (and scanf) toturial with example?

    Some advanced features of printf and scanf which aren't used very much like * in printf and scanf, # and $ in printf, scope number and etc. If you just know many yourself, can say some very useful ones in here as response.



    Thanks!
    Last edited by nabat1; 01-23-2013 at 12:57 AM.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    You can search the Web for documentation on these functions.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    16
    I couldn't find simple description. If u know gimme, plz...

    Thanks!

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Standards should be clear on this issue so I am very tempted to tell you to apply some intelligence to this area.

    printf:
    fprintf
    scanf:
    fscanf

    You can find information on $ here:
    printf(3): formatted output conversion - Linux man page

    AFAIK, $ does not make sense in scanf.

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    16
    It is not with example and brief. I don't want whole the printf and scanf. I think $ is not part of standard C and is part of Unix. Right?


    Thanks!

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    If you are too lazy to read the documentation available to you, then good luck with your programming career, which will be very short lived, if it does not die stillborn.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help. printf() and scanf().
    By HBK in forum C Programming
    Replies: 19
    Last Post: 07-17-2011, 04:04 PM
  2. printf clear variables
    By phbunyan in forum C Programming
    Replies: 4
    Last Post: 07-03-2010, 06:25 AM
  3. printf advanced!!
    By gooddevil in forum C Programming
    Replies: 9
    Last Post: 05-25-2004, 07:45 AM
  4. nested if-else forgot how to clear scanf
    By ronin in forum C Programming
    Replies: 4
    Last Post: 06-25-2002, 09:53 PM
  5. advanced scanf in c programming
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 12-07-2001, 07:44 AM