Advertisement

simple setw/setiosflags question

Started by February 05, 2001 09:37 PM
1 comment, last by ghostboy 23 years, 11 months ago
Ok, in the console, I''m trying to align a string to the left, and then align another string to the right, all on the same line. but it won''t work! im using setiosflags(ios::left/right). these are the only align combinations that work for me.. align right, then left align right, then right align left, then left but i can''t get output to align to left, then right. why?? o and.. I see "->" in alot of C++ coding, what does it do, when would someone use it?
  cout << setiosflags(ios::right) << "This is right justtified";cout << setiosflags(ios::left, ios::adjustfield) << "This is left justified on the same line" << end;  


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
We are creating a Multi-player space strategy/shoot-em-up/RPG game.
Development is well under way and we do have a playable demo.
Always looking for help.
Digital Euphoria Soft

Advertisement
your coding gives me the errors.

C:\Microsoft Visual Studio\MyProjects\32\w.cpp(31) : error C2660: ''setiosflags'' : function does not take 2 parameters

C:\Microsoft Visual Studio\MyProjects\32\w.cpp(31) : error C2065: ''end'' : undeclared identifier

and didnt you read my post, i said i need to align something to the left, then align something to the right.

This topic is closed to new replies.

Advertisement