![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
without_fetter
这个作者很懒,什么都没留下…
展开
-
C++ 学习之路 - 基本操作
C++ 基本语言/ 引入 in and out stream#include这个语句可以引入cout 或 cin;如: cout << “请输入六位密码” << endl;cin >> key;// 定义命名空间using namespace std;// 定义主函数int main() {// input your codesreturn...原创 2020-04-01 12:47:35 · 125 阅读 · 0 评论 -
C++ 文件的读写(转载)
C++ 文件的读写 在看C++编程思想中,每个练习基本都是使用ofstream,ifstream,fstream,以前粗略知道其用法和含义,在看了几位大牛的博文后,进行整理和总结:这里主要是讨论fstream的内容:#include <fstream>ofst...转载 2020-04-02 11:11:09 · 1391 阅读 · 0 评论 -
C++ 学习之路 基本操作(二)
C++ 学习操作基本之路(二)一、条件语句1. if 类型if 类型就如上次我提到的逻辑语句 Exp1 ? Exp2 : Exp3如果我想通过年龄来推荐的书籍,根据少不读《水浒》,老不读《三国》,可以这么表达:#include <iostream>using namespace std;int main() { // 输入年龄 int age; cout <...原创 2020-04-03 12:46:39 · 3537 阅读 · 0 评论 -
c++ 学习之路(三)
c++ 学习之路(三)循环语句while在这里插入代码片#include using namespace std;int main() {while(condition) {// commander}}如果我门原创 2020-04-04 15:05:15 · 129 阅读 · 0 评论 -
c++ 学习之路(n+3) string.find()函数
c++ 学习之路(n+3)cstring 中 string.find() 函数string.find()函数用于寻找string中是否包含这个字符或字符串。如:#include <iostream>#include <cstring>using namespace std;int main() { stirng name = "da la ben ba"; ...2020-09-25 09:54:56 · 118 阅读 · 0 评论 -
c++ 学习之路(四)数组
c++ 学习之路(四)数组数组初始化可以先定义容量然后在赋值。#include <iostream>using namespace std;int main() { // define a list int a[2]; a[1] = 1; a[0] = 2; for(int i =0; i<2; i++) { // 2 1 cout <<...原创 2020-04-07 17:24:02 · 149 阅读 · 0 评论 -
# c++ 学习之路 (vector用法)
c++ 学习之路 (vector用法)定义vector 是一个可变大小数组的序列容器。它可以像数组一样储存数据,但是又比数组灵活,可以动态改变。vector的初始化和赋值如下所示:#include <iostream>#include <vector>using namespace std;int main() { // 声明一个int 型向量 vecto...转载 2020-04-12 18:05:38 · 101 阅读 · 0 评论 -
C++ 学习之路(五) c_str()
C++ 学习之路(n)一、string 类型的函数1. c_str()c_str() 是c++ 字符串类型的函数,其返回当前字符串首字符的地址,主要以const char* 形式得到string内容。通常与strcpy服用效果更佳。直接上代码:#include <iostream>#include <cstring>using namespace std;in...原创 2020-04-22 12:20:01 · 304 阅读 · 0 评论