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

string

Name: Anonymous 2012-05-23 12:46

What the hell went wrong?  We started with just this:

   char a[100];
   strcpy(a, "a string");
   strcat(a, " more");

And someone said "Hey, it would be better if the programmer didn't have to declare that 100 manually...  Is there some way the string itself could just resize as characters are added?"

Now, you can't really fault whoever it was for thinking that.  It seems like a reasonable idea.  But tell me, how the fuck did we get from that idea to this?

http://www.sgi.com/tech/stl/string

It's just...  horrible.

Name: Anonymous 2012-05-23 13:02

>>1
Oh, and don't forget, if you want your strings to also have the amazing functionality of sprintf() and sscanf(), you'll also need the ABOMINATIONS known as std::istringstream and std::ostringstream...  But those probably won't do what you want, so you might as well go ahead and download boost::format(), which you can only get by installing the ENTIRE BOOST LIBRARY, which is over TEN THOUSAND separate files.

Your hard drive is now completely full, so you can't build anything, but if you could, you'd be able to do almost exactly the same neat stuff you could do with sprintf() and sscanf().

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