Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

iomanip

Name: Anonymous 2011-03-26 16:05

Just a quick question. In C++ does formatting with iomanip stay consistent between classes?

For instance, if, in main, I set precision to 3 and then call a method to print a linked list from another class would the precision stay at 3 or would I need to setup iomanip in the linked list class?

Name: Anonymous 2011-03-26 16:09

Just use printf.

Name: Anonymous 2011-03-26 16:09

printf my anus

Name: Anonymous 2011-03-26 16:09

Yes, it's process wide. Once you set it, it stays the same until you change it again. Learn how imperative programming works, yo. However, professional C++ programmers don't use C++ iostreams/locales. C style printf is the way to go for the performance conscious C/C++ developer.

Name: Anonymous 2011-03-26 16:18

Thanks guys. Sorry I don't use printf but this is just easier since I want everything to the precision(1).

Name: Anonymous 2011-03-26 23:14

>>3
printf("%s\n", "my anus");

Don't change these.
Name: Email:
Entire Thread Thread List