Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. class Human
  7. {
  8. private:
  9. string name;
  10. public:
  11. Human(string name) : name(name) { }
  12. virtual void show();
  13. };
  14.  
  15. void Human::show()
  16. {
  17. cout << "Human: " << name << endl;
  18. }
  19.  
  20. class Student : public Human
  21. {
  22. private:
  23. string schoolName;
  24. public:
  25. Student(string name, string schoolName) : Human(name), schoolName(schoolName) { }
  26. void show();
  27. };
  28.  
  29. void Student::show()
  30. {
  31. Human::show();
  32. cout << "Student: " << schoolName << endl;
  33. }
  34.  
  35. int main()
  36. {
  37. int foo[2] = [1, 2];
  38. cout << foo[1] << foo[2] << endl;
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement