The C in C++
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->
随机推荐
- percona-toolkit工具包的使用教程
http://blog.chinaunix.net/uid-20639775-id-3236916.html 本文收集了percona-toolkit工具包中比较常用的工具集,写成教程,方便自 ...
- 日志分析(二) logstash patterns
grok-patterns内置了很多基础变量的正则表达式的log解析规则,其中包括apache的log解析(同样可以用于nginx的log解析). 基于nginx日志分析配置: 1.配置nginx ...
- cisco路由器配置教程
配置cisco路由器 经过几十年的发展,从最初的只有四个节点的ARPANET发展到现今无处不在的Internet,计算机网络已经深入到了我们生活当中.随着计算机网络规模的爆炸性增长,作为连接设备的路由 ...
- Linux下*.tar.bz2等文件如何解压--转
如果tar不支持j这个参数就先用 bzip2 -d xxx.tar.bz2 把它解压成.tar文件,然后再用 tar xvf xxx.tar 拆包.压缩解压 linux下怎么解后缀名是gzip的文件? ...
- visual studio 2013 c++ 打开code map 功能
属性->c++ -> Browse Infomation -> Enable Browse Infomation设为true http://msdn.microsoft.com/li ...
- Header 与 Footer 的 DIV 高度固定, 中间内容 DIV高度自适应,内容不满一页时,默认填满屏幕。
一.需求: 页面布局分三大块: Header Body Footer 1.内容不满一页时,Footer 在屏幕最底部,Body 填充满 Header 与 Footer 中间的部分. 2.当缩小浏览器时 ...
- storyBoard中的Segue跳转
//———————————————--------------在不确定的Segue跳转----------------------------------- 多个按钮指向要跳转的视图 1.在一个恰 ...
- Linux下的权限掩码umask
权限掩码umask 我们都知道在linux下创建一个文件或者目录之后是可以通过chmod等命令进行权限设置,来达到给当前用户.用户组用户以及其他用户分配不同的访问权限.那么,我们新创建的目录和文件本身 ...
- [BigData]关于HDFS的伪分布式安装和虚拟机网络的配置
[BigData]关于Hadoop学习笔记第一天(段海涛老师)(三) 视频2: hadoop的应用在电商,"浏览了该商品的人还看了","浏览了该商品的人最终购买的&quo ...
- Window 中常见的dos命令
在哪里操作dos命令: win7---->开始---->所有程序---->附件---->命令提示符 win7-- ...