![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
Juvenile__
这个作者很懒,什么都没留下…
展开
-
C++笔记总结(第四周)
一、static_cast功能:用来强迫隐式类型转换,或称为显式的类型转换例如: 将非const对象转换为const对象(但是不能将底层const对象转换为非const对象,这个只有const_cast才能做到) 将int转换为double,反之亦然 也可以将void*指针转换为其他类型指针,将pointer-to-base转换为pointer-to-derived 注意事项:...原创 2020-03-23 20:40:30 · 142 阅读 · 0 评论 -
C++笔记总结(第三周)
自定义函数 VS 宏函数#define ADD(a,b) a + b //宏函数int add(int a,int b){ return a + b;}//自定义函数int main(){ cout << add(5,6) << endl;//通过函数名找到函数存放的位置,给形参分配空间,传参,执行函数体里语句,函数返回,释放空间 ...原创 2020-03-13 12:17:28 · 125 阅读 · 0 评论 -
C++笔记总结(第二周)
Register1、Register作用:提高程序的运行效率,省去了cpu到内存中抓取数据的时间。#include<stdio.h>int main(){ register int num = 5; return 0;}register:不能修饰全局变量,也不能修饰函数,只能修是局部变量。volatile :防止编译器将所修饰的变量加载到寄存器中进行优化volat...原创 2020-03-11 10:28:32 · 124 阅读 · 0 评论 -
C++笔记总结(第一周)
c to c++for加强 1、允许使用类似 for(i = 0; i < 100; i++)的语句,且语句中的 i 只在此for语句中有效。 2、int arry[5] = {1,2,3,4,5}; for( int temp : arry) { cout << temp <<denl; }...原创 2020-02-28 12:53:06 · 147 阅读 · 0 评论