Created
October 9, 2019 18:08
-
-
Save cirosantilli/d438e38f05a92422f909c0571a2dac16 to your computer and use it in GitHub Desktop.
gdb cout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
struct MyClass { | |
int i; | |
MyClass() { i = 0; } | |
}; | |
std::ostream& operator<<(std::ostream &oss, const MyClass &my_class) { | |
return oss << "MyClass: i = " << my_class.i; | |
} | |
int main() { | |
MyClass i; | |
std::cout << i << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment