Thread: How to display item at specific tab position

  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    18

    How to display item at specific tab position

    Hi, I used VB6 before to output file.

    I set my output to file to tab(20) or tab(45) respectively.

    In C++, how do I do this?

    I am a new programmer in C++.

    Could anyone enlighten me about this?

    Thank you very much indeed!

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Look up how to use setw from the <iomanip> header.
    They are not very easy to use, though.
    You may find C's printf function or Boost.Format more convenient.

  3. #3
    Registered User
    Join Date
    Oct 2013
    Posts
    18
    Thanks manasij7479, could you show me some examples of how to use setw, printf function or Boost.Format?

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Ignore printf.
    setw: setw - C++ Reference
    Boost.Format: The Boost Format library - 1.55.0
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Oct 2013
    Posts
    18
    Thanks Elysia for your suggestions & help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 08-19-2013, 12:01 AM
  2. Replies: 3
    Last Post: 02-17-2011, 06:21 AM
  3. writing in a specific position
    By overlord21 in forum C Programming
    Replies: 6
    Last Post: 09-28-2008, 03:44 PM
  4. Can't display item from an array
    By grscot in forum C++ Programming
    Replies: 16
    Last Post: 05-06-2003, 11:04 AM
  5. searching for a specific item in a C++ file
    By stanleyw in forum C++ Programming
    Replies: 1
    Last Post: 06-03-2002, 04:54 PM