![]() |
| | #1 |
| Registered User Join Date: Feb 2002
Posts: 2
| how to align text? |
| kuyajay is offline | |
| | #2 |
| I'm Back Join Date: Dec 2001
Posts: 556
| use gotoxy or other text spacing functions. in graphics.h there is centre_text,vert_dir etc etc..
__________________ - |
| ihsir is offline | |
| | #3 |
| Registered User Join Date: Feb 2002
Posts: 2
| thanks for the reply bud but...i am the newbiest of the newbies...i dunnos what you just said =) im trying to create a program where it asks you to input anything and it will print of the screen what you just typed but instead, its aligned or justified to the right... also i read another topic where it says you can't or have to set a number of spaces to justify something to the right. is that true? |
| kuyajay is offline | |
| | #4 |
| Registered User Join Date: Feb 2002
Posts: 33
| I read that you can have anything a certain number of spaces somewhere... let me find it... here it is The manipulator to set something a certain number of spaces out it setw(# of spaces out) in order for setw to work, you need to include <iomanip.h>. here's how it would work #include <iostream.h> #include <iomanip.h> int main(void) { int a, b, c; cout <<"please enter three numbers with different numbers of digets\n"; cin >>a>>b>>c; cout <<"your numbers were, in reverce order:\n" << setw(5)<<c<<"\n"<<setw(5)<<b<<"\n"<<setw(5)<<a<<"\ n"; return 0; } well, very simple, but I think this is what you were looking for. |
| Dummies102 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| My text doesn't display | joeprogrammer | Game Programming | 11 | 02-23-2006 10:01 PM |
| Appending text to an edit control | dit6a9 | Windows Programming | 3 | 08-13-2004 09:52 PM |
| Text positioning and Text scrolling | RealityFusion | C++ Programming | 3 | 08-13-2004 12:35 AM |
| Scrolling The Text | GaPe | C Programming | 3 | 07-14-2002 04:33 PM |
| MFC. displaying text in a label recieved from a Edit Field box | gazza | C++ Programming | 1 | 07-13-2002 05:45 PM |