
![]() |
m0nkeymafia
In C++ it is seamingly difficult to concatonate different types easily.
Fear not the STL and m0nkeymafia are here to help Observe stringstreams in action ![]() int num1 = 24; float num2 = 7.45; std::stringstream formatter; formatter << "My Age Is: " << num1 << ", my penis size is: " << num2; //you can get the string via formatter.str(), you can even get the character array via formatter.str().c_str() You can, like mentioned in a previous post, modify the widths of numbers, and other such things. STL FTW perkiset
Streams rock, but I have a hard time grokking them. When I apply myself to looking at the mechanics and syntax of using functions for them I can make it work, but for some reason I have this huge block about them... particularly when mixing file streams and web streams and string streams and soft flowing clear blue streams... just hard to get my arms around.
Perhaps it's even the sort of "backward" notation of the example you posted - just bounces off my brain. m0nkeymafia
Yeah streams rock, anything i can helop with lemmie know perk
sorry im drunk mauhahaa ![]() thedarkness
I always seem to use std:
![]() Cheers, td m0nkeymafia
dont know diff between the two
ostringstreams rock though there is a bug where std::stringstream implementation in vs2005 actually leaks memory slowly. so always use ostringstream for most your string stuff. my favourite thing is making classes and functions that output to a stream i.e. you pass it a std: ![]() thedarkness
Under do
tnetI'd be using a stringbuilder object.Cheers, td |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads