网站首页 站内搜索

搜索结果

查询Tags标签: std,共有 1098条记录
  • C++基础 利用指针访问数组

    #include <iostream> using namespace std; int main() {//利用指针访问数组 int a[5]={1,2,3,4,5};int *p=a;for(int i=0;i<5;i++){cout<<*p<<" ";p++;}return 0; }

    2022/2/20 22:32:51 人评论 次浏览
  • C++ 11 应用

    第一章 使用C++11让程序简洁、现代 1.1 类型推导 1.1.1 auto为在编译期推理和替换,使用auto声明的变量必须马上初始化。 auto推导规则不声明 *指针 或 &引用 时,auto推导结果 和 初始化表达式 抛弃引用和cv限定符后 的类型一致; 声明 *指针 或 &引用 时,auto推…

    2022/2/20 17:27:03 人评论 次浏览
  • C++中的友元关系

    #include<iostream>#include<string>class Lovers{ public: Lovers(std::string name){ this->name=name; } void kiss(Lovers*lovers); void ask(Lovers *lovers,std::string something); protected: std::string name; friend class Others; };c…

    2022/2/20 14:26:36 人评论 次浏览
  • C++11没有#include\<string\>也可以使用string

    C++11没有#include<string>也可以使用string 在c++11中,这段代码可以运行 //并未包含<string> #include <iostream> using namespace std;int main() {string s1 = "Hello";cout<<s1<<endl;return 0; }能运行的原因如下:std::i…

    2022/2/18 17:13:49 人评论 次浏览
  • 第一章编程题

    1 #include<iostream> using namespace std;int main() {cout<<"name: \nAddress: UESTC";return 0; } 2 #include<iostream> using namespace std;int convert(int n);int main() {int n;cin >> n;cout<< n <<" long…

    2022/2/14 14:11:50 人评论 次浏览
  • C++基础 自增与自减

    #include <iostream> using namespace std; int main(){//后置递增 先计算在递增 int a1=1,b1=0;b1=b1+(a1++);//b1=1 cout<<"a1="<<a1<<endl;cout<<"b1="<<b1<<endl;//前置递增 先递增后计算 int a2=1,…

    2022/2/14 12:13:07 人评论 次浏览
  • 对拍linux

    #include<bits/stdc++.h>using namespace std;int main(){ int i; for (i=1;;i++){ printf("The result of No. %d Case is: ",i); system("./rand"); system("./std"); system("./tmp");…

    2022/2/14 7:13:09 人评论 次浏览
  • C++ Primer记录_第一章

    文章目录 第一章 开始1.1 编写一个简单的C++程序1.1.1 编译、运行程序 1.2 初识输入输出1.3 注释简介1.4 控制流1.4.1 while 语句1.4.2 for 语句1.4.3 读取数量不定的输入数据1.4.4 if语句 1.5 类简介1.5.1 Sales_item类1.5.2 初始成员函数 1.6 书店程序第一章 开始 1.1 编…

    2022/2/14 1:15:19 人评论 次浏览
  • C++ string split 字符串

    #include <vector> #include <string> #include <algorithm> #include <iostream> #include <cstdint> #include <string.h>void str_split(char* src,const char* split,std::vector<std::string> &res){char* ptr = null…

    2022/2/13 12:44:54 人评论 次浏览
  • Ubuntu 16.04 通过 CMake 编译 Grpc C++ 项目

    注:参考代码取自 grpc 源码目录下的 examples\cpp\helloworld1. 安装 protoc 工具下载 Grpc_v1.43.0_SetupFile.zip 文件,解压到任意目录下载链接:https://pan.baidu.com/s/1HYjfQb8CQY56QF2iAGmBNw 提取码:grg0 将解压后的 Grpc_v1.43.0_SetupFile/bin 中 的 protoc…

    2022/2/12 7:18:03 人评论 次浏览
  • C++实现对Json数据的友好处理

    背景 C/C++客户端需要接收和发送JSON格式的数据到后端以实现通讯和数据交互。C++没有现成的处理JSON格式数据的接口,直接引用第三方库还是避免不了拆解拼接。考虑到此项目将会有大量JSON数据需要处理,避免不了重复性的拆分拼接。所以打算封装一套C++结构体对象转JSON数据…

    2022/2/11 20:13:03 人评论 次浏览
  • c++ 一些操作

    typedef 使用 比如, typedef G4THitsCollection<B2TrackerHit> B2TrackerHitsCollection; 将 G4THitsCollection<B2TrackerHit> 重命名为 B2TrackerHitsCollection 文件流作为函数参数1 void fitshape(std::ofstream &ffo, TString fitfunc, Int_t s…

    2022/2/11 9:12:28 人评论 次浏览
  • 代码随想录:哈希表

    前言哈希表是通过关键码的值而进行直接访问的数据结构 数组也是一张hash表,只不过数组的关键码就是他的下标,或者说是索引 hash表最强大就在于它可以快速判断一个元素是否在一个集合里面,时间复杂度$O(1)$ hash方法&hash函数在密码学里,哈希函数是指对一串消息做计…

    2022/2/9 23:14:14 人评论 次浏览
  • C++使用onnxruntime/opencv对onnx模型进行推理(附代码)

    1. c++使用onnxruntime进行推理 link code in git #include <opencv2/core.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/opencv.hpp> #include <opencv2/highgui.hpp> #include <opencv2/core/core.hpp> #include <opencv…

    2022/2/9 22:15:51 人评论 次浏览
  • 第2单元 C++程序基础

    第2单元 C++程序基础文章目录 第2单元 C++程序基础2.1 Aloha World程序1. 功能描述2. 源文件3. 知识点及感想 2.1 C++的输入输出1. 关于输入输出2. 程序代码示例2.1 Aloha World程序 1. 功能描述在屏幕上输出“Aloha World”。 2. 源文件 #include<iostream>//输入输…

    2022/2/9 14:42:28 人评论 次浏览
扫一扫关注最新编程教程