'small' tabbing

This is a discussion on 'small' tabbing within the C Programming forums, part of the General Programming Boards category; Hello there, I'm wondering how I could make 2 character tabs in C... It's so that if I have, say, ...

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    79

    'small' tabbing

    Hello there,

    I'm wondering how I could make 2 character tabs in C...

    It's so that if I have, say, the variables a, b, c and d...

    I would like to have something like a*2 , b*2 etc... aligned under a, b etc... in printf. But as you can appreciate a*2, b*2, etc... could be 1 or 2 characters. So I need a tab that is only 2 characters...

    How could I achieve this?

    Thanks

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Have you looked at how printf works? Especially the bit where they talk about "field width".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to split long programe in small files
    By umeshjaviya in forum C Programming
    Replies: 11
    Last Post: 04-15-2008, 03:45 AM
  2. Small HTTP proxy
    By zacs7 in forum Networking/Device Communication
    Replies: 8
    Last Post: 09-11-2007, 04:53 AM
  3. want to make this small program...
    By psycho88 in forum C++ Programming
    Replies: 8
    Last Post: 11-30-2005, 02:05 AM
  4. FILES in WinAPI
    By Garfield in forum Windows Programming
    Replies: 46
    Last Post: 10-02-2003, 07:51 PM
  5. yhatzee, small straight
    By uglyjack in forum C++ Programming
    Replies: 2
    Last Post: 06-13-2002, 04:09 AM

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