c++ cout autocase strings?
-
20-08-2019 - |
Question
Is it possible to do something like cout << "my string"; and have my string capitalized? from what i can tell there is no way to do it? i need to wrap it around a function
Solution
Yes, you can extend std:streambuf See this example: http://www.java2s.com/Tutorial/Cpp/0240__File-Stream/Extendsstdstreambuftocreateoutputbuffer.htm
OTHER TIPS
Use the Boost string_algo library:
string myStr("my string");
to_upper(myStr);
cout << myStr;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow