C声明中的指针
2016-06-20 01:29
441 查看
C声明中的指针
参考
http://www.cdecl.org/http://unixwiz.net/techtips/reading-cdecl.html
指针
int i; declare i as int const int i; declare i as const int ---------- int * p; declare p as pointer to int int ** p; declare p as pointer to pointer to int int *** p; declare p as pointer to pointer to pointer to int const int * p; declare p as pointer to const int const int ** p; declare p as pointer to pointer to const int const int *** p; declare p as pointer to pointer to pointer to const int int * const p; declare p as const pointer to int int ** const p; declare p as const pointer to pointer to int int *** const p; declare p as const pointer to pointer to pointer to int const int * const p; declare p as const pointer to const int const int ** const p; declare p as const pointer to pointer to const int const int *** const p; declare p as const pointer to pointer to pointer to const int int * const * p; declare p as pointer to const pointer to int int * const ** p; declare p as pointer to pointer to const pointer to int int * const *** p; declare p as pointer to pointer to pointer to const pointer to int int ** const * p; declare p as pointer to const pointer to pointer to int int *** const * p; declare p as pointer to const pointer to pointer to pointer to int const int * const * p; declare p as pointer to const pointer to const int int ** const * const p; declare p as const pointer to const pointer to pointer to int const int ** const * const p; declare p as const pointer to const pointer to pointer to const int ---------- int a[]; declare a as array of int int a[10]; declare a as array 10 of int int a[10][15]; declare a as array 10 of array 15 of int int *a[10]; declare a as array 10 of pointer to int int **a[10]; declare a as array 10 of pointer to pointer to int int ***a[10]; declare a as array 10 of pointer to pointer to pointer to int int *a[10][15]; declare a as array 10 of array 15 of pointer to int int **a[10][15]; declare a as array 10 of array 15 of pointer to pointer to int int ***a[10][15]; declare a as array 10 of array 15 of pointer to pointer to pointer to int int (*a)[10]; declare a as pointer to array 10 of int int (**a)[10]; declare a as pointer to pointer to array 10 of int int (***a)[10]; declare a as pointer to pointer to pointer to array 10 of int int (*a)[10][15]; declare a as pointer to array 10 of array 15 of int int (**a)[10][15]; declare a as pointer to pointer to array 10 of array 15 of int int (***a)[10][15]; declare a as pointer to pointer to pointer to array 10 of array 15 of int int *(*a)[]; declare a as pointer to array of pointer to int int **(*a)[]; declare a as pointer to array of pointer to pointer to int int ***(*a)[]; declare a as pointer to array of pointer to pointer to pointer to int int *(**a)[]; declare a as pointer to pointer to array of pointer to int int *(***a)[]; declare a as pointer to pointer to pointer to array of pointer to int ---------- int f(); declare f as function returning int int * f(); declare f as function returning pointer to int int ** f(); declare f as function returning pointer to pointer to int int *** f(); declare f as function returning pointer to pointer to pointer to int int f(int); declare f as function (int) returning int int * f(int); declare f as function (int) returning pointer to int int ** f(int); declare f as function (int) returning pointer to pointer to int int *** f(int); declare f as function (int) returning pointer to pointer to pointer to int int (*f) (int); declare f as pointer to function (int) returning int int (**f) (int); declare f as pointer to pointer to function (int) returning int int (***f) (int); declare f as pointer to pointer to function (int) returning int int * (*f) (int); declare f as pointer to function (int) returning pointer to int int ** (*f) (int); declare f as pointer to function (int) returning pointer to pointer to int int *** (*f) (int); declare f as pointer to function (int) returning pointer to pointer to pointer to int ---------- int *(*(**foo[][8])())[]; declare foo as array of array 8 of pointer to pointer to function returning pointer to array of pointer to int int *(*(**foo[5][8])())[]; declare foo as array 6 of array 8 of pointer to pointer to function returning pointer to array of pointer to int ----------
相关文章推荐
- 关于指针的一些事情
- C# Pointer指针应用实例简述
- C和指针小结(推荐)
- C++智能指针实例详解
- 浅谈C++指针(必看)
- C++指向函数的指针实例解析
- 关于c语言指针的两处小tip分享
- 浅谈c/c++中使用指针需要注意的问题
- 浅析iterator与指针的区别
- 探讨C++中数组名与指针的用法比较分析
- C++编程指向成员的指针以及this指针的基本使用指南
- 详解C++中的指针、数组指针与函数指针
- C++中字符串以及数组和指针的互相使用讲解
- C语言安全之数组长度与指针实例解析
- C++中指向对象的常指针与指向常对象的指针详解
- 指向变量的常指针与指向常变量的指针详细解析
- C#通过指针实现快速拷贝的方法
- 深入理解c++指针的指针和指针的引用
- php中将指针移动到数据集初始位置的实现代码[mysql_data_seek]
- C#通过指针读取文件的方法