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->
随机推荐
- Chronometer控件实现的Android计时器
本文为大家演示了如何使用Chronometer控件实现Android计时器的实例. 先贴上最终的实现效果图: Android计时器实现思路 使用Chronometer控件实现计器的操作.通过设置set ...
- Nginx 1.4.7图片缓存服务器
软件包版本: Nginx 1.4.7 Ngx_cache_purge-2.0 Openssl-1.0.1 Pcre-8.32 二.安装编译: a) 下载pcre-8.32.tar.gz ...
- 解读Unity中的CG编写Shader系列4——unity中的圆角矩形shader
上篇文章中我们掌握了表面剔除和剪裁模式 这篇文章将利用这些知识实现一个简单的,可是又非经常常使用的样例:把一张图片做成圆角矩形 例3:圆角矩形Shader 好吧我承认在做这个样例的时候走了不少弯路,因 ...
- mysql 面试
数据库的重要性是所有技术里最核心最需要掌握的(理解原理,并且被面试时能清晰的表达出来),直接决定运维人员薪水的高低! 所有题都要给出专业的解答方案,不是很水的那种泛泛的解答. 面试题001:什么是My ...
- jquery如何实现domReady和onload判断的
function ready(fn) { var completed = function() { if ( document.addEventListener ) { document.remove ...
- Sublime Text 3 常用快捷键总结
1.快速跳转到某一行:Ctrl+G,输入行号,可以快速跳转到该行 2.快速查找:Ctrl+P 输入"@函数名"可以快速查找到函数 输入"#+文本" 3.多行游标 ...
- 项目源码--Android基于LBS地理位置信息应用的客户端
下载源码 技术要点: 1. LBS应用框架客户端实现 2. 登录与注册系统 3. TAB类型UI实现 4. HTTP通信模块 5. 源码带详细的中文注释 ...... 详细介绍: 1. LBS应用框架 ...
- 称球问题(zt)
下面说的这个问题可能大家都看到过,它是这么描述的: 现在有n(n>=2)个球,n个球外观一模一样,但是重量有区别,其中有且仅有一个球的重量比其它n-1个球要重,现在有一个天平,天平是完好无损的, ...
- C语言之指针与数组总结
和指针相关的问题口诀1: 1. 地址变量得地址,得谁地址指向谁 和指针相关的问题要画图: 内容变量画房子,指针画箭头 ---->口 ------------------------------- ...
- android 读取串口数据的服务
2016-09-1813:10:03 继承Service,定义抽象方法onDataReceived,子类通过实现抽象方法获取接收到数据的回调. package com.zrsoft.liftad.se ...