- 1
- 0
- 约8.54千字
- 约 8页
- 2016-08-02 发布于重庆
- 举报
CPrimerPlus第二单元源码
//compounddecls.cpp
#include iostream
int main()
{
// i is an int; p is a pointer to int; r is a reference to int
int i = 1024, *p = i, r = i;
// three ways to print the value of i
std::cout i *p r std::endl;
int j = 42, *p2 = j;
int *pref = p2; // pref is a reference to the pointer p2
// prints the value of j, which is the int to which p2 points
std::cout *pref std::endl;
// pref refers to a pointer; assigning i to pref makes p point to i
pref = i;
std::cout *pref std::endl; // prints the value of i
// dereferencing pref yields i, the int to which p2 po
您可能关注的文档
最近下载
- ABB 传动变频器 ACS880起重机控制程序(选件+N5050)固件手册 安装及使用手册.pdf
- (正式版)DB42∕T 2481-2025 《急性心血管疾病院前救护规程》.docx VIP
- 《二次根式》计算100题(专项练习).doc VIP
- (高中物理)《传感器》知识梳理.pdf
- 2024事业单位工勤技能考试考前冲刺试卷及参考答案详解(新).docx
- 2024-2025学年度计算机二级考试黑钻押题及完整答案详解【各地真题】.docx
- 宣贯培训(2026年)《DLT 2806—2024智能配电台区技术导则》.pptx VIP
- 《模拟电子技术基础》复习题.doc VIP
- 2025年安徽师范大学招聘专职辅导员(第二批)4人预笔试备考题库及答案解析.docx VIP
- 2024工程硕士预测复习及完整答案详解【全国通用】.docx
原创力文档

文档评论(0)