Help with Borland error message

This is a discussion on Help with Borland error message within the C++ Programming forums, part of the General Programming Boards category; Hi, when i try too add this follwoing code then compile i get an error: "Size of 'Tokenize' is unknown ...

  1. #1
    Unregistered
    Guest

    Help with Borland error message

    Hi, when i try too add this follwoing code then compile i get an error: "Size of 'Tokenize' is unknown or zero"

    Anybody know why I get this error?


    void Tokenize(const string& str,
    vector<string>& tokens,
    const string& delimiters = " ")
    {
    // Skip delimiters at beginning.
    string::size_type lastPos = str.find_first_not_of(delimiters, 0);
    // Find first "non-delimiter".
    string::size_type pos = str.find_first_of(delimiters, lastPos);

    while (string::npos != pos || string::npos != lastPos)
    {
    // Found a token, add it to the vector.
    tokens.push_back(str.substr(lastPos, pos - lastPos));
    // Skip delimiters. Note the "not_of"
    lastPos = str.find_first_not_of(delimiters, pos);
    // Find next "non-delimiter"
    pos = str.find_first_of(delimiters, lastPos);
    }
    }

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    it compiles fine with gcc (including int main(), and including headers)

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21