Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class student {
- private:
- string name, surname;
- int age;
- public:
- student(string _name, string _surname, int _age);
- void print();
- ~student();
- };
- student::student(string _name, string _surname, int _age) {
- name = _name;
- surname = _surname;
- age = _age;
- }
- void student::print() {
- cout << name << " " << surname << " " << age << endl;
- }
- student::~student() {
- }
- int main() {
- student s("a", "b", 100);
- s.print();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement