>But now i'm confused about that (-1) part.
Don't worry about it, it's irrelevant to the task at hand. However, if you're interested, string::size_type is an unsigned type, meaning that it cannot have a negative value (as Mario said). However, if you assign a negative value to an unsigned type, the value wraps around to a large positive value. So if you say:
You're actually setting x's value to the largest positive value that an unsigned integer can hold.Code:unsigned int x = -1;