
grelbr at hotmail
Aug 29, 2001, 7:09 AM
Post #4 of 4
(264 views)
Permalink
|
strombrg [at] seki (Dan Stromberg) wrote in message news:<9mh27s$dmi$1 [at] news>... [snip] > IE, can the standard c++ library take a string, split it up on a > particular separator character, and return the corresponding list of > strings? > > I know I can write something to do this, but I'd rather learn how to > use the STL or similar, if applicable. Well, there's strtok(). But, I personally think the best use of that function is as a teacher of the unwary. Before you elect to use that function, make sure you read the *entire* description in your docs, all the way to the end and every word. Be sure to pay attention to the fact that there is a static storage space involved, and be sure you know what that implies. Maybe I sound pretty grumpy on this point. But that's because, some years ago, I blindly used strtok() without paying attention to that stuff. Don't you be like I was. Get smart sooner rather than later. grelbr
|