J
Josephine Schafer
Dave said:hi
another simple problem sorry. i've got a string, "Buffer", and an int, Loop.
Somehow, this:
Buffer.length<=Loop+1
gives this:
error C2296: '<=' : illegal, left operand has type 'unsigned int (__thiscall
std::basic_string<char,struct std::char_traits<char>,class std::allocato
r<char> >::*'
Buffer.length should return an int, correct? loop is certainly an int. what
am i doing wrong?
No.
Buffer.length returns std::string::size_type and not int.
Try this -
#include <string>
int main()
{
std::string Buffer("abc");
std::string::size_type loop = Buffer.length ();
}
HTH,
J.Schafer