azizny
06-19-2008, 12:15 PM
I am trying to explode a string in c++ using string operations:
// read in user input
std::cout << "Please enter operation:\n";
std::cin >> operation;
while(operation.empty()){
string::size_type loc = operation.find( " ", 0);
cout << "Found space at " << loc << endl;
operation.erase(operation.at(loc).size());
}
I have looked many places, and size should be an operation for strings, however, I keep getting this error:
error C2039: 'size' : is not a member of 'System::SByte'
I also tried length (which should be the same thing), similar error.
Thanks for any help,
Peace,
// read in user input
std::cout << "Please enter operation:\n";
std::cin >> operation;
while(operation.empty()){
string::size_type loc = operation.find( " ", 0);
cout << "Found space at " << loc << endl;
operation.erase(operation.at(loc).size());
}
I have looked many places, and size should be an operation for strings, however, I keep getting this error:
error C2039: 'size' : is not a member of 'System::SByte'
I also tried length (which should be the same thing), similar error.
Thanks for any help,
Peace,
