main.cpp 415 Bytes
Newer Older
刘睿博's avatar
ver 1.0  
刘睿博 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stdio.h>
#include "Human.hpp"
#include "Student.hpp"
#include <vector>

int main(int, char**){
    printf("Hello, from stl_debug!\n");
    std::vector<Human*> vec;
    Human human(25, "John Doe");
    Student student(20, "Jane Doe", "MIT");
    vec.push_back(&human);
    vec.push_back(&student);
    for (const auto& h : vec) {
        h->print();
    }
    static_cast<Student*>(vec.back())->print();
}