Hello. I have a string which looks like
[5 64 3 22 1...] and I need to read these numbers.
The logical implementation was to read the string char by char and
check whether I have a space and when I find one I could create a
vector with all the numbers (after i convert them to number of course).
the problem is that when i am trying to do so I have errors with both
implementations that i have tried.
for(my_iter = mla.begin(); my_iter != mla.end(); my_iter++)
{
if (*my_iter != " ")
cout << *my_iter;
}
thesis.cpp(1103) : error C2446: '!=' : no conversion from 'const char
*' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or
function-style cast
thesis.cpp(1103) : error C2040: '!=' : 'int' differs in levels of
indirection from 'const char [2]'
or by this code
for(iiii = 0; iiii < mla.length(); iiii++)
{
if (mla[iiii]* != " ")
cout << mla [iiii] << "-";
}
thesis.cpp(1103) : error C2446: '!=' : no conversion from 'const char
*' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or
function-style cast
thesis.cpp(1103) : error C2040: '!=' : 'int' differs in levels of
indirection from 'const char [2]'
Can anyone help
Cheers
Costantinos