博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C++小知识点
阅读量:4050 次
发布时间:2019-05-25

本文共 1290 字,大约阅读时间需要 4 分钟。

记录c++学习中的小知识点.

1.输入输出

#include 
using namespace std;/************************//* 这是第一个c++程序*//************************/int main(){ cout<<"hello world"<< " yunlan"; cout<
> x; cout << oct << x <
> y; cout << boolalpha << y << endl; system("pause"); return 0;}

2.命名空间

#include 
#include
using namespace std;/************************//* 命名空间*//************************/namespace mynum{ int x = 105;}int main(void){ bool isflag = false; if(mynum::x % 2 == 0) { isflag = true; } else { isflag = false; } if(isflag) { cout << "偶数" << endl; } else { cout << "基数" << endl; } system("pause"); return 0;}

3.引用

#include 
#include
using namespace std;/************************//* 引用*//************************/int main(void){ /*基本数据类型的引用*/ int a = 3; int &b = a; b = 10; cout << "a="<
<< endl; /*指针的引用*/ int c = 10; int *p = &c; int *&q = p; *q = 20; cout << "c="<< c <

4.堆内存、ram

#include 
#include
using namespace std;/************************//* 堆内存,ram*//************************/int main(void){ int a = 10; int *p = &a; cout<<*p<<","<

<

转载地址:http://qsnci.baihongyu.com/

你可能感兴趣的文章
NSNotificationCenter 用法总结
查看>>
C primer plus 基础总结(一)
查看>>
剑指offer算法题分析与整理(三)
查看>>
pidgin-lwqq 安装
查看>>
mint/ubuntu安装搜狗输入法
查看>>
C++动态申请数组和参数传递问题
查看>>
opencv学习——在MFC中读取和显示图像
查看>>
C/C++中关于动态生成一维数组和二维数组的学习
查看>>
JVM并发机制探讨—内存模型、内存可见性和指令重排序
查看>>
nginx+tomcat+memcached (msm)实现 session同步复制
查看>>
c++模板与泛型编程
查看>>
WAV文件解析
查看>>
WPF中PATH使用AI导出SVG的方法
查看>>
WPF UI&控件免费开源库
查看>>
QT打开项目提示no valid settings file could be found
查看>>
Win10+VS+ESP32环境搭建
查看>>
android 代码实现圆角
查看>>
flutter-解析json
查看>>
android中shader的使用
查看>>
java LinkedList与ArrayList迭代器遍历和for遍历对比
查看>>