Consider the following code:

Code:
string dup(char c, int n) {
    string s;
    s.clear();
    s.insert(s.begin(), n, c);
    return s; }
My compiler is: Microsoft Visual C++ 6.0

The compiler error I receive is:
h:\c++\proj12ateame\basicutils.h(32) : error C2039: 'clear' : is not a member of 'basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'

This code works FINE on Microsoft Visual Studio .NET 2003, yet it doesn't on Visual C++ 6.0? If someone could explain to me what's going on, I would be grateful.

The header files I have included with this code are <string> and <math.h>

Thanks again guys. You're very helpful.