博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
The C in C++
阅读量:4627 次
发布时间:2019-06-09

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

1 unnamed arguments in the argument list of the function definition    (Page 114)

In c++, an argument may be unnamed in the argument list of the function definition. Since it is unnamed , you cannot use it in the function body, of course. Unnamed arguments are allowed to give the programmer a way to "reserve space in the argument list." Whoever uses the function must still call the function with the proper arguments. However, the person creating the function can then use the argument in the future without forcing modification of code that calls the function.

2 numbers of arguments       (Page 114)

2.1 an empty argument list

func():   In C++, it tells the compiler there are exactly zero arguments.

     In C, it means an indeterminate number of arguments.

func(void):  In C and C++, it means an empty argument list.

2.2 a variable argument list

func(...):  you should restrict your use of variable argument lists in C and avoid them in C++.

3 Introduction to the pointers

Each of the elements in the program has a location in storage when the program is running. Even the function occupies storage.

4 Specifying storage allocation    (Page 147)

gloal variables,

local variables,

register variables(avoided),

static variables(it is unavailable outside its definition scope, such as function scope or file scope. And you can define a function's local variable to be static and give it an initial value, the initialization is performed only the first time the function is call, and the data retains its value between function calls),

extern variables,

constants variables(a const must always hava an initialization value, and its value never change),

volatile variables(you will never know when this will change, and prevents the compiler from performing any optimizations based on the stability of that variable),

5 function address    (Page 198)

Once a function is compiled and loaded into the computer to be executed, it occupies a chunk of memory. Thus the funciton has an address.

When you are looking at a complex definition, the best way to attack it is to start in the middle and work your way out. middle->right->left->right->

 

转载于:https://www.cnblogs.com/ruccsbingo/p/3680953.html

你可能感兴趣的文章
跟我学SpringCloud | 第七篇:Spring Cloud Config 配置中心高可用和refresh
查看>>
openGL 六边形
查看>>
openGL 蓝天白云
查看>>
openGL 画线条
查看>>
pyqt5desinger的安装即配置
查看>>
openGL 折线
查看>>
python 通过函数的使用,将字典的深度搜索化简(减少循环次数)
查看>>
openGL 大作业之n星变换
查看>>
pyqt图标
查看>>
python 文件操作
查看>>
ASCII码对照表
查看>>
很棒的积极自我暗示语
查看>>
《linux系统及其编程》实验课记录(一)
查看>>
本学期(大三下学期)学习目标
查看>>
painting fence - 分治 - Codeforces 448c
查看>>
游戏模型规范
查看>>
【养老政策】关于鼓励民间资本参与养老服务业发展的实施意见
查看>>
python爬虫之多线程、多进程、GIL锁
查看>>
【转】gcc编译优化---likely()与unlikely()函数的意义
查看>>
完成评论功能
查看>>