随笔分类 -  C++

摘要:面向对象三大特性:封装,继承,多态 其中多态在C++里是通过虚函数来实现的,主要实现的功能是继承里父类的指针调用子类的功能函数。 覆盖:覆盖虚函数才能实现多态。覆盖普通函数并不能实现多态… 重载:和多态没有半毛钱关系,本质上重载其实是不同的函数 纯虚函数:函数声明加=0。强制子类实现,不能实例化。 阅读全文
posted @ 2017-08-25 15:47 fosonR 阅读(139) 评论(0) 推荐(0)
摘要:#include <sys/types.h> #include <dirent.h> std::vector<std::string> get_all_filename(char* dirname) { DIR *dp; struct dirent* dirp; std::vector<std::s 阅读全文
posted @ 2017-08-01 18:08 fosonR 阅读(571) 评论(0) 推荐(0)