Skip to content

Instantly share code, notes, and snippets.

@ichtrojan
Created September 30, 2018 14:26
Show Gist options
  • Save ichtrojan/5207ffd5a349973ff0e61a9a454f65f2 to your computer and use it in GitHub Desktop.
Save ichtrojan/5207ffd5a349973ff0e61a9a454f65f2 to your computer and use it in GitHub Desktop.
creating a behaviour in c++
#include <iostream>
using namespace std;
class human {
public:
string name;
int age;
void run () {
cout << name <<" is running" << endl;
}
};
int main () {
human exhibitA;
exhibitA.name = "Michael";
exhibitA.run();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment