create blank charaters (white spaces)

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: May 2008
Posts: 6
Reputation: grommet2481 is an unknown quantity at this point 
Solved Threads: 0
grommet2481 grommet2481 is offline Offline
Newbie Poster

create blank charaters (white spaces)

 
0
  #1
May 18th, 2008
I know that this is a simple one but never the less I forget how to do it.
How do I create white spaces on my screen.

Im writting in DEV-C++. I want my output to look something like this

Name title pay
Sam Uni student shit

I know how to output everything on the page but just don't know how to space them out. I know that I could do it by doing a cout statment followed by inverted comma and a shit load of spaces (or as required) inverted comma, semicolon. But that will look messy.

Im just chasing the simple code on how to create those spaces, my friend taught me and my text book sucks and it doesn't teach me.

Cheers
SAM
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,358
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1463
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: create blank charaters (white spaces)

 
0
  #2
May 18th, 2008
If you are using cout then you can use setw()
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main(int argc, char* argv[])
  6. {
  7. cout << setw(10) << "Hello";
  8. return 0;
  9. }
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 6
Reputation: grommet2481 is an unknown quantity at this point 
Solved Threads: 0
grommet2481 grommet2481 is offline Offline
Newbie Poster

Re: create blank charaters (white spaces)

 
0
  #3
May 18th, 2008
Sweet, that was exactly what I was looking for. Thanks mate.

SAM
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC