![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
文章平均质量分 92
Augus_Xu
这个作者很懒,什么都没留下…
展开
-
c++ cout cerr clog的区别
c++ primer 第五版 对于cout,ceer,clog的定义如下:cout(ostream): object used to write to the standard output. Ordinarily used to write the output of a program. cerr(ostream): object tied to the standard error,转载 2017-08-07 11:29:57 · 780 阅读 · 0 评论 -
c++ cin输入
一直有个疑问当使用while(cin >> val1)时是否会要求输入数据,是否会陷入死循环,因此做了如下实验。#include #includeusing namespace std;int main(){ int a,sum; sum=0; while(cin>>a) sum+=a; cout<<sum<<endl; s原创 2017-08-07 20:45:01 · 273 阅读 · 0 评论 -
顶层const和底层const的说明
const修饰符在修饰指针变量时候会有顶层const和底层const的区别,先看代码 int a=10;int b=20; int const *below = &a; int *const above = &a; cout<<below<<" "<<*below<<endl; //below=0x6afef4 *below=10 below =原创 2017-08-15 11:04:01 · 298 阅读 · 0 评论 -
C++ primer 练习 - 12章:动态内存
C++ primer 练习 - 12章:动态内存原创 2017-09-06 11:08:58 · 340 阅读 · 0 评论 -
c++智能指针和内置指针的转化
在使用智能指针的过程中踩得一些坑~做点总结以更好的理解智能指针普通指针转化为内置指针int* iPtr = new int(42);shared_ptr<int> p(iPtr);int a =10;shared_ptr<int> p(a);内置指针转化为普通指针int* pI = p.get();一些需要注意的地方1. 内置指针转智能指针void f(shared_ptr<int>转载 2017-09-08 10:16:10 · 3459 阅读 · 1 评论 -
C++ primer 练习 - 13章:拷贝控制
C++ primer 练习 - 13章:拷贝控制部分内容参考博客:http://blog.csdn.net/misayaaaaa/article/details/53786215#comments13.1.1 节练习: 拷贝构造函数13.1拷贝构造函数:本身是一个构造函数,其参 数是一个自身类类型的引用,且任何额外参数皆有默认值。13.2这是一个类的拷贝构造函数声明,需要使用引用类型的参数进行初始化原创 2017-09-12 21:20:06 · 427 阅读 · 0 评论 -
C++和控制台实现贪吃蛇小游戏
参见地址: https://github.com/AugusXJ/SnakeGame原创 2017-10-13 15:38:37 · 729 阅读 · 0 评论 -
C++ Primer 12-16章练习
https://github.com/AugusXJ/Cpp-Primer原创 2017-10-16 11:19:26 · 209 阅读 · 0 评论