fork download
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5. class human {
  6. public:
  7. string name;
  8. int age;
  9. human(string, int);
  10. };
  11.  
  12. human::human(string name, int age) {
  13. this->name = name;
  14. this->age = age;
  15. }
  16.  
  17. int main() {
  18. human gabriel("Gabriel Sales", 16);
  19. cout << gabriel.name;
  20. }
  21.  
  22. //https://pt.stackoverflow.com/q/44627/101
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Gabriel Sales