Last active
August 29, 2015 14:12
-
-
Save Rayer/b75c5d4c1768d231631e to your computer and use it in GitHub Desktop.
This file contains 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> | |
#include <string> | |
#include <typeinfo> | |
using namespace std; | |
class foo { | |
std::string name; | |
public: | |
foo(); | |
std::string getName(); | |
}; | |
foo::foo() : name(typeid(*this).name()) { | |
} | |
std::string foo::getName() { | |
return name; | |
} | |
int main(int argc, char *argv[]) { | |
foo f; | |
std::cout << f.getName(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment