Re: Object method does not respond
Regardless of whether string2::len() does what it's supposed to, which I didn't check, this would never output the string length:
Code:
cout << "\nTamanho de S1: "; s1.len();
what you actually want probably rather is this:
Code:
cout << "\nTamanho de S1: " << s1.len();
In contrast, this does what you expect it to do:
Code:
cout << "\nS1 = "; s1.print();
This may seem paradox compared to the above, but it only "works" because string2::print() does the printing entirely on its own inside its implementation; the cout at the beginning of this line has nothing to do with that.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.