Problem with setw
I'm having a problem with setw that I haven't been able to find any information anywhere for. I can't get setw (or the iosflags like left and right for that matter) to work on strings that are being returned by a function using Dev-C++. Like so:
Anyone know if this is fixable? I had no problems at all using M$ Visual C++ at home...
cout<<setw(25)<<s<<endl; // this works
cout<<setw(25)<<func()<<endl; // this doesn't work
Send back a NULL terminate string.
cout << func().c_str();
See if that fixes the problem.
Thanks!! That worked perfectly! :D