摘要:
include include using namespace std; class Human { public: Human(int age,int number,string addr); ~Human(); static void getCount(); private: static in 阅读全文
摘要:
1.当一个标识符(变量或函数)被声明为 static 时,它只在定义它的编译单元(文件) 内可见,其他文件无法访问。 include include using namespace std; class Human { public: Human(int age,int number,string 阅读全文
摘要:
include include <stdlib.h> using namespace std; int * add(int x, int y) { int sum = x + y; return ∑ } 》此时的sum的周期就是函数运行完就没 》所以在mian函数中接不到 》在mian函数中接是错误 阅读全文
摘要:
a) 在C++中新增加了引用的概念 b) 引用可以看作一个已定义变量的别名 c) 引用的语法:Type& name = var; d) 引用做函数参数那?(引用作为函数参数声明时不进行初始化) // demo 8-23.c include <stdio.h> include <stdlib.h> i 阅读全文