随笔分类 - C/C++
摘要:https://www.52jbj.com/article/506190.html http://www.jb51.net/article/35771.htm
阅读全文
摘要:解决方案1:在cpp文件中放置.c,且在该文件中引用变量 解决方案2:在一个cpp文件中包含.c,但在另一个cpp文件中使用结构体变量 cpp文件1 cpp文件2 不知道是什么原因,但是实验证明可行
阅读全文
摘要:1. RTTL 运行时类别识别,在只有一个指向基类的指针或引用时确定一个对象的准确类型。 2.什么是拷贝构造函数 是单个形参的构造函数,实参是与该类同属一类的对象;在类定义中,如果未提供自己的拷贝构造函数,C++提供一个默认拷贝构造函数,该默认拷贝构造函数完成一个成员到另一个成员的拷贝。 3. 什么
阅读全文
摘要:#include #include #include using namespace std; void showStr(const char * str, int & n) { cout 0) { showStr(str, --n); } } int test8_1() { char str[] = "hello cat"; int n = 2; showStr(st...
阅读全文
摘要:#include using namespace std; double Sum2(double x, double y) { double sum = 0; if (x + y >x>>y) && x != 0 && y!=0) { sum = Sum2(x, y); cout > scores[i]; i++) { if (scores[i]volume = b1...
阅读全文
摘要:#include #include #include #include #include #include #include using namespace std; int t6_1() { char ch; cout donations = { 0 }; cout > donations[i]) { if (++i average) { c...
阅读全文