Thread: What does "conversion specification" means?

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    7

    What does "conversion specification" means?

    I'm still a beginner so this question might be a little be too easy for the most of you, but please help out.
    I'm currently reading "C Programming - A Modern Approach." In its chapter 3, when it talks about the format string. It says:"The format string may contain both ordinary characters and conversion specifications, which begin withe the % character."

    What does the "conversion specification" means?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I'm guessing you should keep reading approximately one to two paragraphs, where conversion specifications are covered. (I don't have the book, so I can't provide the exact amount you have to read.) Or, if that fails, use the index.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    "Format string".... with respect to what?

    On a guess that you mean printf(), scanf(), etc.
    The simple answer is ... Look up the functions in your C library documentation.

    One of the most important skills a programmer develops is the ability to "look stuff up".

    Also as tabstop suggests... keep reading, it's likely explained in the next page or so.
    Last edited by CommonTater; 08-05-2011 at 09:03 AM.

  4. #4
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    It is referring to how the data should be represented or stored. For a simple example look at printf's specifier. Those specifiers are conversion specifications, same goes for scanf, sscanf, ect.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    How about our very own faq page which explains all this nice and dandy.

  6. #6
    Registered User
    Join Date
    Jul 2011
    Posts
    14
    Quote Originally Posted by Roger Lo View Post
    I'm still a beginner so this question might be a little be too easy for the most of you, but please help out.
    I'm currently reading "C Programming - A Modern Approach." In its chapter 3, when it talks about the format string. It says:"The format string may contain both ordinary characters and conversion specifications, which begin withe the % character."

    What does the "conversion specification" means?
    I have that book O_o
    That was my 1st year univ textbook for C lol.

    Just keep reading is the best answer lol.
    You have to read like a chapter more to find out I think;;;
    You'll realize once you really start to program such as printing a variable.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. conversion from char string e.q. "AA" to UTF-8 format
    By quickNitin in forum C Programming
    Replies: 10
    Last Post: 09-07-2006, 09:01 AM
  2. Replies: 0
    Last Post: 04-21-2006, 01:41 PM
  3. what does "close wait" and "fin_wait2" means?
    By hanhao in forum Networking/Device Communication
    Replies: 0
    Last Post: 07-18-2005, 05:14 AM
  4. "itoa"-"_itoa" , "inp"-"_inp", Why some functions have "
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 12-08-2002, 08:25 AM
  5. "CWnd"-"HWnd","CBitmap"-"HBitmap"...., What is mean by "
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 07:59 AM