![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++笔记
丼静
这个作者很懒,什么都没留下…
展开
-
C++笔记之函数
使用C++函数时需要提供的内容: 1)函数的定义 2)函数原型 3)函数调用 一、函数基本知识 1、函数的定义 函数的定义分为有返回值和无返回值两种,无返回值函数称为void函数,格式: void functionName(parameterList) { statement(s); return; //可选 } 有返回值: typeName functionName(parameterList) { statement(s); return value; //必须 } 返回值可以是常量、变原创 2020-10-08 16:08:24 · 374 阅读 · 0 评论 -
C++笔记之文本输入
1、使用cin和循环结合进行文本输入 #include <iostream> int main() { using namespace std ; int count= 0; char ch ; cout << "Please enter character,end with # :\n"; cin >> ch ; while (ch != '*') { count++ ; cout <&原创 2020-09-19 09:38:27 · 653 阅读 · 0 评论 -
C++小结<1>数据类型
以下内容主要一《C++ primer Plus》为参考 一、C++入门 二、数据类型 三、循环及关系表达式 四、分支及逻辑运算符 五、函数原创 2020-09-14 17:02:29 · 431 阅读 · 0 评论 -
C++笔记之复合类型
1.string类 使用string类首先需要包含string头文件,且其位于std名称空间之中,所以在使用string时需用using或std::string两种方式,其使用类似与字符数组,但与数组不同的在于string的长度可以自动的调节 使用方式为string name ;例:string str ; str = "word"也可以在声明的时候直接赋值。可以使用cin >> str来读入string类变量;且string类变量可以进行拼接 这里是引用 ...原创 2020-07-18 16:03:09 · 103 阅读 · 0 评论