摘要: class和struct的区别就是class需要指明private 和 public 而 struct不需要 /* 类定义 */ #include <iostream> using namespace std; struct Student { public: void eat(const stri 阅读全文
posted @ 2020-03-31 11:03 c语言我的最爱 阅读(601) 评论(0) 推荐(0) 编辑
摘要: static_cast 表示静态变量的类型转换, 如int->char, 不合适的类型转换将会发生错误 /* static_cast 类型转换 */ #include <iostream> using namespace std; int main() { int* pi = NULL; //cha 阅读全文
posted @ 2020-03-31 11:02 c语言我的最爱 阅读(807) 评论(0) 推荐(0) 编辑