I know this may make me look stupid, (aren't we all) but I was attempting to use the operator[] function to find a character in a string by it's position, and I think I might have used it in the wrong way...did I?
I'm not trying to be mean. I just don't see the point of writing out the full qualification of the operator. I mean, what would the point of overloading an operator be, if it didn't make anything more efficient or intuitive?
I don't know what you just said... I was just trying to figure out how to refer to the position of a character in a string. I still don't know how to use operator and I probably wont need it for my simple programs anyway.
If you're using the standard lib String class, you can refer to a specific element of the string as Disch said with str[1], or also with str.at(1) which throws an exception when accessing an element outside the string boundaries, which you can choose to handle or not. But that's probably not something to worry about now.
The notation you were using was explicity calling the overloaded [] operator function. You just messed up a bit at the end. But that's a silly notation to ever use :) cout << str.operator[](1);