printf field width

This is a discussion on printf field width within the C Programming forums, part of the General Programming Boards category; hello, I am new to c programming, and now solving some problems from c primer plus. I would like to ...

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    10

    printf field width

    hello, I am new to c programming, and now solving some problems from c primer plus. I would like to ask about the printf conversion specifier that prints a string in a field three character wider than the string.
    any help will be greatly appreciated.
    thank you.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    2,675
    Did you read the documentation for printf()? Pay particular attention to the width and precision specifiers.

    Jim

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Setting width in printf with a #define macro?
    By noobiept in forum C Programming
    Replies: 6
    Last Post: 06-25-2010, 07:25 AM
  2. Replies: 9
    Last Post: 07-21-2009, 08:52 PM
  3. Replies: 2
    Last Post: 06-07-2009, 08:49 AM
  4. Printf: somehow it changed a structure field.
    By Artemiy in forum C Programming
    Replies: 3
    Last Post: 04-04-2009, 11:27 AM
  5. Field width
    By vandalay in forum C Programming
    Replies: 3
    Last Post: 11-30-2003, 01:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21