C 语言中一些非常用知识点 备忘录
来源:互联网 发布:百利甜酒 知乎 编辑:程序博客网 时间:2024/05/02 04:42
在看一些C语言资料时,总是碰到一些非常见的知识点,看过就忘,这里把他们记录下来。
7. ----> 什么是Designated initializers for aggregate types (C only),看了IBM的解释更易懂,
Designated initializers, a C99 feature, aresupported for aggregate types, including arrays, structures, and unions. Adesignated initializer, ordesignator, points outa particular element to be initialized. Adesignatorlist is a comma-separated list of one or more designators. A designatorlist followed by an equal sign constitutes adesignation.
- Elements within an aggregate can be initialized in any order.
- The initializer list can omit elements that are declared anywhere in theaggregate, rather than only at the end.Elements that areomitted are initialized as if they are static objects: arithmetic types areinitialized to 0; pointers are initialized to NULL.
- Where inconsistent or incomplete bracketing of initializers for multi-dimensionalarrays or nested aggregates may be difficult to understand, designators canmore clearly identify the element or member to be initialized.
struct xyz { int a; int b; int c; } klm = { .a = 99, .c = 100 };
int aa[4] = { [2] = 3, [1] = 6 };static short grid[3] [4] = { [0][0]=8,[0][3]=1, [2][0]=9, [2][1]=3, [2][2]=1, [2][3]=1 };
6.---->C99 permits declarations anywhere within a block. Previous Versions of C permitted them only before the first statment. 参考(C语言参考手册) chapter 4.3
5.----> Statement labels have function scope. 意思就是说用于goto 语句的标号的作用范围是一个函数内。-reference 《C A reference manual》chapter:4.2.1;8.10
4.---->什么是 incomplete type?
如果有如下定义:
structure foo;
structure foo *pFoo;
then the expression *pFoo is an experession with incomplete type,because the type srtucture foo have not been fully defined.
3.----> 什么是 qualified type,什么是 fully qualified type?
2.---->The C99 function specifier(inline) can appear only on function declarations. -----reference 《C A reference manual》(C语言参考手册) chapter 4.1
1.---->声明一个东西时(一个变量,一个类型,一个函数等),我们需要declaration-specifiers,总共有如下四种specifiers: 参考(C语言参考手册) chapter 4
storage-class-specifier, type-specifier, type-qualifier, function-specifier
其中 storage-class-specifier 有:auto, extern,register,static,typedef
其中Type specififiers 主要提供数据类型信息,有 enumeration,floating-point,interger,structure,typedef-name,union,void
其中type qualitifer 主要是提供更多额外的信息,尤其是在accessing objects of the type through lvalues. 有:const,volatile,restrict.
- C 语言中一些非常用知识点 备忘录
- C语言一些知识点
- C语言常用知识点
- C语言常用知识点
- c语言常用知识点
- sqlserver常用知识点备忘录
- c语言中一些常用的函数
- C语言中一些不常用函数
- C语言的一些知识点
- C语言的一些知识点
- oracle常用小知识点备忘录
- android开发常用知识点备忘录
- C语言的一些偏僻知识点
- 忘记的C语言中的一些知识点
- C语言内存相关的一些知识点
- C语言中会常用到的一些小程序
- C语言中关于字符串的一些常用函数
- C语言中一些常用IO函数的总结
- RBAC权限管理
- SQL优化大全
- 4、STYLE-------------labview宝典
- checking for void pointer length... yes configure: error: Size of "void *" is less than size of "lon
- 第三方框架终极版
- C 语言中一些非常用知识点 备忘录
- 写技术博客的心得.
- Eclipse搭建Cocos2d-x运行环境问题
- jQuery中$(document).ready()方法与传统JavaScript中的window.onload的差异
- Hibernate Annotation (Hibernate 注解)
- java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widg
- uva 208 Firetruck
- busybox启用telnetd服务
- linux服务器上的11种tcp状态