Student.cpp 353 Bytes
Newer Older
刘睿博's avatar
ver 1.0  
刘睿博 committed
1
#include "Student.hpp"
刘睿博's avatar
1  
刘睿博 committed
2
#include "Human.hpp"
刘睿博's avatar
刘睿博 committed
3
#include "cstring"
刘睿博's avatar
1  
刘睿博 committed
4 5
#include <sstream>
#include <string>
刘睿博's avatar
ver 1.0  
刘睿博 committed
6 7 8 9 10

Student::~Student() {
    printf("Student destructor called\n");
}

刘睿博's avatar
1  
刘睿博 committed
11 12 13 14 15 16
std::string Student::print() const {
    std::string res;
    std::stringstream ss;
    ss << Human::print();
    ss << "I'm from " << school_ << "\n";
    ss >> res;
刘睿博's avatar
刘睿博 committed
17
    return res;
刘睿博's avatar
ver 1.0  
刘睿博 committed
18
}