Posted: Wed Aug 04, 2004 10:23 pm Post subject: [C++] Why use the STL? A quick example
So, let's say you want to remove all bad characters (to be defined) from a string. First we'll look at the problem solved without the STL, then taking advantage of it.
For both examples we'll want a function which can test to see if a character matches what we'll consider a "bad" character.
code:
bool bad_char(char source)
{
// return true if the character is the letter o.
return (source == 'o');
}