上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
摘要: <c++ primer plus>第六版 7 函数 7.1 复习函数的基本知识 没有返回值的函数: void FunctionName(parameterList) { statments return; //optional } 有返回值的函数 typeName FunctionName(para 阅读全文
posted @ 2022-07-10 11:07 编程驴子 阅读(25) 评论(0) 推荐(0) 编辑
摘要: <c++ primer plus>第六版 6 分支语句和逻辑运算符 6.1 if语句 if (test-condition) { statement1 } else if(test-condition) { statement2 } else { statement3 } 实际上, 上述语句只是嵌套 阅读全文
posted @ 2022-07-10 11:03 编程驴子 阅读(53) 评论(0) 推荐(0) 编辑
摘要: <c++ primer plus>第六版 5 循环和关系表达式 5.1 for循环 语法 for (initialization; test-expression; update-expression) { body } 5.2 while循环 while (test_condition) { bo 阅读全文
posted @ 2022-07-10 10:59 编程驴子 阅读(33) 评论(0) 推荐(0) 编辑
摘要: <c++ primer plus>第六版 4 复合类型 4.1 数组 声明数组的格式: typeName arrayName[arraySize]; //声明一个数组, 内容未定; typeName arrayName[arraySize] = {20, 30}; //声明一个数组, 并初始化, 初 阅读全文
posted @ 2022-07-10 10:55 编程驴子 阅读(12) 评论(0) 推荐(0) 编辑
摘要: mysql学习笔记 1. 安装 ... 2. 启动/关闭服务器 2.1 启动服务器 以下两个命令都可以启动服务器。 命令1:net start MySQL 命令2:mysqld -console 服务器启动后,才能对MySQL数据库做操作。 2.2 关闭服务器 以下两个命令都可以关闭服务器。 命令1 阅读全文
posted @ 2022-07-08 19:46 编程驴子 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 通过迭代器遍历vector和map的操作见以下链接: c++ vector基本知识 c++ map基本知识 使用迭代器iterator //使用迭代器iterator auto iter0 = v.begin(); //返回第一个元素对应的迭代器 auto iter1 = v.end() ; //返 阅读全文
posted @ 2022-06-17 10:58 编程驴子 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 说明: c++使用的头文件有两种: (a) c语言的头文件,. (b) c++的头文件. 这两种头文件在c++引入namespace概念后都做过一次修改: (a) 修改前都是.h后缀, 没有namespace, 是全局作用域. (b) 修改后都去掉了.h后缀, 纳入namespace std. 内容 阅读全文
posted @ 2022-06-13 17:00 编程驴子 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 1. c++指针 指针是对象, 跟普通对象一样, 它有地址&p和存储的值p, 与普通对象的区别是p存储的值是其它对象的地址. 要得到指针指向的对象的值, 需要使用解引用操作符: *p 指针p涉及的写法: p : 指针p这个对象存储的值, 是指针p指向的对象的地址 . p: 指针p指向的对象的值, " 阅读全文
posted @ 2022-06-10 17:28 编程驴子 阅读(73) 评论(0) 推荐(0) 编辑
摘要: c++ 在class A的构造函数中初始化另一个类的对象(调用B::B())时报错: error: no matching function for call to 'B:B()' 1. 现象 看如下代码: class B, 构造函数接受一个int参数i_b, 并赋值给this->b, #inclu 阅读全文
posted @ 2022-06-04 15:24 编程驴子 阅读(906) 评论(0) 推荐(0) 编辑
摘要: #读写文件 #include <fstream> #include <iostream> #include <string> #include <unistd.h> //使用access和F_OK int main() { //读文件 std::string ifile_name= "test.tx 阅读全文
posted @ 2022-06-02 14:31 编程驴子 阅读(128) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页