c traps and pitfalls reading note(1)
1. 一直知道char *p = 'a';这样写是错误的,但是为什么是错的,没想过,今天看书解惑。
p指向一个字符,但是在c中,''引起来的一个字符代表一个整数,这样指针能不报错。o(^▽^)o
2.函数声明部分中(*(void (*)())0)(),看到这样的一个声明,我是觉得恶心,静下心来,慢慢分析呗。
( *( void (*pf)() )0 )(), 首先最外层(*(ppf)0)())——(这是什么鬼,强制转换,没看懂,搜了下,说是硬件地址跳到0处就是这么写的) ,ppf = ( void (*pf)() ) ,然后没什么好说的了,pf是一个函指,->一个返回void类型的函数。
c traps and pitfalls reading note(1)的更多相关文章
- c traps and pitfalls reading notes(2)
1.运算符优先级,这个我是肯定记不住,每次遇到的时候都纠结下,然后去查下,或者直接括号,但是括号太多,你懂得,要用notepad才能理清各种层次.这里啦个下来,留着参考.
- [转载] C 陷阱与缺陷( C traps and Pitfalls )
本文转自 https://www.xuebuyuan.com/1951579.html 自己找工作过程中复习过的书包括<C traps and Pitfalls>,<编程珠玑> ...
- 【Reading Note】算法读书杂记
1 排序 排序基本信息 稳定性:排序前大的数在排序后,大的数依然保持不变就是稳定排序,反之不稳定 内外排序:根据待排序的记录是否放在内存里面区分的.诸如:插入排序(直接插入&希尔).交换排序( ...
- 【Reading Note】Python读书杂记
赋值 >>> list=[] >>> app=[list,list,list] >>> app [[], [], []] >>> ...
- <C Traps and Pitfalls>笔记
//------------------------------------------------------------------------------ 2.1 理解函数的声明: 编写一个独立 ...
- Python Geospatial Development reading note(1)
chapter 1, Summary: In this chapter, we briefly introduced the Python programming language and the m ...
- 【Deep Learning】Hinton. Reducing the Dimensionality of Data with Neural Networks Reading Note
2006年,机器学习泰斗.多伦多大学计算机系教授Geoffery Hinton在Science发表文章,提出基于深度信念网络(Deep Belief Networks, DBN)可使用非监督的逐层贪心 ...
- Python traps and pitfalls
@1: >>> def func(a, L=[]): ... L.append(a) ... print(L) ... >>> func(10) [10] > ...
- codeforces 434A A. Ryouko's Memory Note(数学)
题目链接: A. Ryouko's Memory Note time limit per test 1 second memory limit per test 256 megabytes input ...
随机推荐
- JS怎样写闰年
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- python--(常用模块-3-正则表达式)
python--(常用模块-3-正则表达式) 正则表达式是对字符串操作的⼀种逻辑公式. 我们⼀般使⽤正则表达式对字符串进⾏匹 配和过滤. 使⽤正则的优缺点: 优点: 灵活, 功能性强, 逻辑性强. 缺 ...
- ASP.NET-表单验证-DataAnnotations
DataAnnotations [数据注解,数据注释] 需要引入两个脚本文件 <script src="@Url.Content("~/Scripts/jquery.val ...
- C#-MSMQ安装及配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...
- Android开发之AlarmManager具体解释
AlarmManager实质是一个全局的定时器,是Android中经常使用的一种系统级别的提示服务,在指定时间或周期性启动其他组件(包含Activity,Service,BroadcastReceiv ...
- 《从零開始学Swift》学习笔记(Day 46)——下标重写
原创文章.欢迎转载.转载请注明:关东升的博客 下标是一种特殊属性. 子类属性重写是重写属性的getter和setter訪问器,对下标的重写也是重写下标的getter和setter訪问器. 以下看一个演 ...
- java之IO处理
File文件基础 文件与文件夹抽象路径名称的表示.其构造方法有四个 File(File parent,String child):从抽象父文件夹下创建一个File实例. File(String par ...
- 51nod-1346: 递归
[传送门:51nod-1346] 简要题意: 给出一个式子a[i][j]=a[i-1][j]^a[i][j-1] 给出a[1][i],a[i][1](2<=i<=131172) 有n个询问 ...
- Git 连接细节
Git 连接细节 首先创建Git 账号 https://github.com/ 下载Git https://git-scm.com/downloads 新建远程仓库 SSH keys : 打开 Git ...
- (转载)打开一个本地apk进行安装
1 2 3 4 5 6 Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); File file = new File ...