原书名:Understanding and using C pointers
原出版社: O'Reilly Media
作者: (美)Richard Reese
译者: 陈晓亮
丛书名: 图灵程序设计丛书
出版社:人民邮电出版社
ISBN:9787115344489
上架时间:2014-2-17
出版日期:2014 年2月
开本:16开
页码:188
版次:1-1
The macros are
NULL
which expands to an implementation-defined null pointer constant;
3 An integer constant expression with the value 0, or such an expression cast to type
void *, is called a null pointer constant.66) If a null pointer constant is converted to a
pointer type, the resulting pointer, called a null pointer, is guaranteed to compare unequal
to a pointer to any object or function.
The macro NULL is defined in <stddef.h> (and other headers) as a null pointer constant; see 7.19.
tony_trh 发表于 2014-03-18 14:51
在DELPHI里直接赋予地址写法是:p=pointer(0x000D)
--------------------------------------------------- ...
之前因为工作需要,刚毕业那几年疯狂研究 C
对于图灵系列(貌似是吧)的C语言图书我看过和复制代码
- 《POINTERS ON C》
这两本书对Pointer都做了很清晰的描述。建议大家看看!复制代码
- 《Expert C Programming》
有时候说什么就是地址、C精华啊。我相信这些话每个学C的人接触指针都对这话感到挺腻。
对于指针理解,理解的人每个人脑海里面都有一套相关联的“地图”,
比如对指针理解浅薄的人脑海中相关联要素为:地址。结构很单一;
而理解深的高手脑海中相关联系要素为: 内存,地址 16进制符号 申请 组织、效率、方式、操纵 释放等等关联起来,形成相关联的脉络网,四通八达。
所以看到一些老鸟之言,视角都很独特,至于接受者能比较好理解那种视角,这就取决于你喜欢萝卜,还是黄瓜了。
虽然C现在很少用了,俺想了想,依稀表达如下:
以C这种平台语言为载体,
1、从数据处理层说: POINTER 是一把钥匙, 让Developer能对诸如内存等相关区域数据操纵自由掌控(代价有啊);
2、从应用代码层说: POINTER 是个百宝箱(“计数器”可能更直观一些),比如在封装机制没有成熟的条件下,为处理一串char的处理也就是str,提供帮助;还有对于一些抽象数据结构(对列,链表、栈等)提供操作; 再说还有一些function之间的调用的入参等等。
POINTER 的特征码: 自由(双刃剑)、强大(说的就是效率)
lid
‘-a number’
‘--ambiguous=number’
List identifiers (not numbers) that are ambiguous for the first number characters. This feature might be in useful when porting programs to ancient pea-brained compilers that don't support long identifier names. However, the best long-term option is to set such systems on fire.
Operations on numbers follow the same rules of the underlying C implementation, which, in turn, usually follows the IEEE 754 standard.
The Number type has exactly 18437736874454810627 (that is, 264−253+3) values, representing the doubleprecision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9007199254740990 (that is, 253−2) distinct "Not-a-Number" values of the IEEE Standard are represented in ECMAScript as a single special NaN value.
Due to the problem noted here, a future version may either add a new function to return function pointers, or the current interface may be deprecated in favor of two new functions: one that returns data pointers and the other that returns function pointers.
windoze 发表于 2014-04-14 17:20
回复 87# Ager
我觉得你折腾了这一圈,构造的只是一个“能安全转化为指向自身指针的指针”,T**永远不是T*,不管你怎么搞。
不过话说回来,搞C的童鞋们本来也就不是特别在乎类型这玩艺儿。
C99里说:
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |