help with positioning text on console

This is a discussion on help with positioning text on console within the C++ Programming forums, part of the General Programming Boards category; Hey I need some help with positioning text on screen. i am wondering if i have to use something like ...

  1. #1
    Registered User cdkiller's Avatar
    Join Date
    Feb 2006
    Posts
    20

    Question help with positioning text on console

    Hey I need some help with positioning text on screen. i am wondering if i have to use something like gotoxy() for this but i absolutly have no idea how to go about doing this. let me show you a sample of how i want to output the data.

    Code:
    Item       Batch        Price        Quantity  
    
    1          1234         1400         100
    
    2          1235         6200         1000
    
    3          1238         2300         150
    
    4          3013         1450         10
    
    5          1701         7450         50
    now the headings (Item, Batch, Price, Quantity) are static but i need to be able to start the numbers right under their heading. so i can guess that would need to use variable.size() or .length() to get the length of the longest number. each number on the list can be any value and any number of digits, within reasonable limits ofcourse. is there some sort of way i could built an invisible table or something and full the data in cells?
    Last edited by cdkiller; 10-01-2006 at 02:55 PM.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,488
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Registered User cdkiller's Avatar
    Join Date
    Feb 2006
    Posts
    20
    sweet. thanks mario. i'll give them a read.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  2. Positioning of Text under Graphical Environment
    By devarishi in forum C Programming
    Replies: 2
    Last Post: 03-17-2009, 02:15 PM
  3. Text Justification for console output
    By greywolf0723 in forum C++ Programming
    Replies: 1
    Last Post: 03-10-2009, 12:29 AM
  4. console text colors??
    By Agent89 in forum C++ Programming
    Replies: 5
    Last Post: 05-24-2002, 10:08 PM
  5. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 09:19 AM

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