Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // should be well-defined behaviour
- #include <iostream>
- int strings_printed = 0;
- std::ostream& operator << (std::ostream& out, const char* str){
- strings_printed++;
- out << std::string(str);
- return out;
- }
- int main ()
- {
- std::cout << "LOL";
- std::cout << "LOL";
- std::cout << "LOL";
- std::cout << "LOL";
- std::cout << 2;
- std::cout << std::endl << strings_printed << " strings were printed";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement