数组,指针
来源:互联网 发布:mac os google chrome 编辑:程序博客网 时间:2024/06/14 10:29
int (*a[10])(int); //函数指针的数组,指向有一个参数并且返回类型均为int的函数的数组int (*a)(int);//函数指针,指向有一个参数并且返回类型 均为int的函数int *a[10]; //指向int类型的指针数组a[10]int (*a)[10]; //指向有10个int类型数组的指针a========== 1. 由变量描述到表达式 ==========本题用变量a给出下面的定义:一个有10个指针的数组,该指针指向一个函数,该函数有一个整形参数并返回一个整型数:1. 定义一个数组a[10]
2. 该数组元素是指针*a[10]3. 该指针指向一个函数,(* a[10]) ()4. 有一个整形参数(* a[10]) (int)5. 并返回一个整形数int (* a[10]) (int)另外一个例子:定义一个函数指针,指向的函数有两个int形参并且返回一个函数指针,返回的指针指向一个有一个int形参且返回int的函数?来自 <http://www.nowcoder.com/questionTerminal/960f8047a9ee4a6f8227768f3bc2734d>1. 定义一个函数指针(*p)2. 指向的函数有两个int参数(*p) (int,int)3. 返回值是一个函数指针* (*p) (int,int) (* (*p) (int,int))4. 返回的指针指向一个int参数(* (*p) (int,int))(int)5. 并返回 intint (* (*p) (int,int))(int)所以:int (* (*p) (int,int))(int)相似的一个例子声明一个指向含有10个元素的数组的指针,其中每个元素是一个函数指针,该函数的返回值是int,参数是int*,正确的是()来自 <http://www.nowcoder.com/questionTerminal/242d747044bd417e95fe37d69884dff8>1. 声明一个指针(*p)2. 该指针指向一个数组(*p)[10]3. 每个元素是一个函数指针(*(*p)[10])()4. 参数是int*(*(*p)[10])(int*)5. 返回值是intint (*(*p)[10])(int*)========== 2. 由表达式到变量描述 ==========经典例子注意: 指向数组的指针和指针数组int *a[10]: a是一个数组,该数组的元素是指针,每个指针都指向一个int型int (*a)[10]:a是一个指针,该指针指向一个数组,数组元素是intFrom http://cdecl.org/int (*a)[10]: declare a as pointer to array 10 of intint *a[10]:declare a as array 10 of pointer to int例子1int (*a[10])(int)1. a是一个数组2. a这个数组的元素是一个指针3. 指针是一个函数指针4. 这个函数参数是int,返回值是inta是一个包含10个元素的数组,每个元素指向一个参数是int,返回值是int的函数。From http://cdecl.org/declare a as array 10 of pointer to function (int) returning int-----------例子2int (*(*p)[10])(int*)1. p是一个指针2. p这个指针指向一个数组3. 数组元素是指针4. 数组元素的指针指向一个函数5. 这个函数参数是int*,返回值是intp是一个指向包含10个元素的数组的指针,每个元素是一个函数指针,指向一个参数是int*,返回值是int的函数。declare p as pointer to array 10 of pointer to function (pointer to int) returning int
0 0
- 指针数组、数组指针
- 指针数组/数组指针
- 指针数组/数组指针
- 数组指针 指针数组
- 指针数组,数组指针
- 数组,指针,数组指针
- 数组,指针,数组指针
- 指针数组&数组指针
- 指针数组&数组指针
- 数组指针 指针数组
- 指针数组/数组指针
- 数组指针&指针数组
- 数组指针 指针数组
- 数组指针 指针数组
- 指针数组 数组指针
- 指针数组,数组指针
- 指针数组 数组指针
- 指针数组&数组指针
- 现代前端技术解析(4)
- [李景山php]每天laravel[035]-laravel 基础知识 --- Eloquent 模型之关系映射
- 科锐课堂笔记:2017/4/10 构造函数与析构函数
- androidSQLite使用
- Spring框架学习(5):bean之间的关系
- 数组,指针
- 04-树5 Root of AVL Tree (25 分)
- POSIX 信号量学习与思考
- 图像的矩,以及利用矩求图像的重心,方向
- 开始学习c语言
- SQLite 清空表格内容,重置自增长为零
- 优化 | 再用传统分页SQL你就死定了
- 剑指offer-面试题10-二进制中1的个数
- WinCE概述