GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 07-Aug-2003, 13:00
dcj1978 dcj1978 is offline
New Member
 
Join Date: Aug 2003
Posts: 1
dcj1978 is an unknown quantity at this point

setiosflags issue


I'm very new to c++ and i'm having trouble with the setiosflags. Here's my code..
CPP / C++ / C Code:
#include <iostream>
#include <iomanip>

using namespace std;
int main()
{
cout << setiosflags(ios::right); 
cout << setw(20) ;
cout << "hello" << endl << endl;
cout << setiosflags(ios::uppercase); 
cout << setw(20) ;
cout << "hello" << endl << endl;

  system("PAUSE");	
  return 0;
}
As you can see, it's a beginners script that doesn't do much but, we all have to start somewhere. Anyway, for some reason, I can't get the "uppercase" to work. It just sets it to the right again.

Any help?

Thanks in advance.
  #2  
Old 08-Aug-2003, 06:16
Garth Farley Garth Farley is offline
Awaiting Email Confirmation
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Maybe after the first cout, call resetiosflags(ios::right).

Do you want uppercae & right aligned text? You can do
setiosflags(ios::right | ios::uppercase);

Hope this helps
GF
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/Apache memory usage issue bacchus Apache Web Server Forum 0 18-Aug-2003 13:57
Possible issue with HTML BBCode? JdS GIDForums™ 2 16-Aug-2003 12:14
Php bbcode issue Caged MySQL / PHP Forum 3 06-Aug-2003 19:55
SQL multiple languages query samtediou MySQL / PHP Forum 6 23-Jul-2003 14:09
Loading issue jrobbio Websites Reviewed Forum 4 15-Jan-2003 06:36

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:41.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.