![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
C++基础
文章平均质量分 62
C++基础
水能zai舟
每一次提交务必慎重,切勿基于样例解题。
展开
-
c++ string相关函数
此篇持续更新loading... append 直接添加另一个完整的字符串: 如str1.append(str2); 添加另一个字符串的某一段子串: to_string toString()方法;数值、字符串、对象、布尔;都有toString方法;这个方法唯一能做的就是返回相应的字符串;其中null和undefined没有toString()方法; #include <bit...原创 2019-03-13 21:04:07 · 425 阅读 · 0 评论 -
第二章:类和对象的特征
/* 第二章:类和对象的特征 */ // 制作人:easy //制作时间:2017-3-7 ...原创 2017-03-16 20:46:37 · 450 阅读 · 0 评论 -
C++之重载数组下标[]与圆括号()运算符的方法
重载数组下标运算符"[]":#include <iostream> using namespace std; class Vector { public: Vector(int a1, int a2, int a3, int a4) { m_nGril[0] = a1 ; m_nGril[1] = a2 ; m_nGril[2] = a...转载 2017-03-24 20:05:07 · 8932 阅读 · 1 评论 -
3-3 C++(new、delete的三种方法操作“动态数组”)
#include<iostream> using namespace std; //2*3数组 int main() { //数组指针法new动态开辟二维数组 /* int (*pt)[3]=NULL; pt=new int [2][3]; for(int i=0;i<...原创 2017-03-16 20:51:23 · 422 阅读 · 0 评论 -
3-3 C++ new、delete 补充:多重指针法
//多重指针法,如有不足欢迎指正 //2*3数组 /* int **p=NULL; p=new int *[2]; for(int i=0;i<2;i++) p[i]=new int [3]; for(int i=0;i<2;i++) ...原创 2017-03-16 20:50:18 · 601 阅读 · 0 评论 -
malloc的开辟----重修订
#include<stdio.h> #include<stdlib.h> //malloc的开辟----重修订 int main() { /*int *p=NULL; p=(int *)malloc(sizeof(int)*4); for(int i=0;i<4;i++) scanf("%...原创 2017-03-16 20:48:55 · 215 阅读 · 0 评论 -
C++ 手动开O2优化
本文转自:https://blog.csdn.net/qq_41289920/article/details/82344586,感谢博主让我涨姿势,蟹蟹! O1优化会消耗少多的编译时间,它主要对代码的分支,常量以及表达式等进行优化。 O2会尝试更多的寄存器级的优化以及指令级的优化,它会在编译期间占用更多的内存和编译时间。 O3在O2的基础上进行更多的优化,例如使用伪寄存...转载 2019-01-21 10:01:36 · 2344 阅读 · 1 评论