Just started

Reply

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

Just started

 
0
  #1
Dec 13th, 2008
I am kind of a neophite and I need your help in the following;
How do you right justify the field output in the <iostream> headerfile and how would one determine the compiler one is using/
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,160
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: 1437
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Just started

 
0
  #2
Dec 13th, 2008
The answer to the first question is easy
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. cout << right << setw(20) << "Hello\n";
  8. }

For the second question, there is no portable way to do that. Some compilers pre-define macros that indicate the compiler and compiler's version, while other compilers don't. So the only sure-file way to do it is to declare the macros yourself for each compiler you want to support.
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: 5
Reputation: cplspls is an unknown quantity at this point 
Solved Threads: 0
cplspls cplspls is offline Offline
Newbie Poster

Re: Just started

 
0
  #3
Dec 13th, 2008
Thanx
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC