C/Cpp指针
来源:互联网 发布:黑人和小女孩网络对唱 编辑:程序博客网 时间:2024/06/13 18:02
C/Cpp指针
参考:
http://en.cppreference.com/w/c/language/pointer
动画演示 http://cslibrary.stanford.edu/
https://en.wikibooks.org/wiki/C_Programming/Pointers_and_arrays
http://publications.gbdirect.co.uk/c_book/chapter5/pointers.html
http://publications.gbdirect.co.uk/c_book/chapter5/function_pointers.html
四种“普通”变量
- int i; // integer variable ‘i’ 变量i里面放int型值,用int规则来访问
- int *p; // pointer ‘p’ to an integer 变量p里面只能放地址(即指针),用pointer规则来访问
- int a[]; // array ‘a’ of integers 数组,连续存储着的同型变量
- int f(); // function ‘f’ with return value of type integer 函数,把f用function规则来访问
其中:
int arr[10]; // arr is an array of 10 const ints
int arr[5];printf("length is: %ld and %ld", sizeof(arr[0]), sizeof(arr));//运行结果:length is: 4 and 20
- int **pp; // pointer ‘pp’ to a pointer to an integer
- int (*pa)[]; // pointer ‘pa’ to an array of integer
- int (*pf)(); // pointer ‘pf’ to a function with return value integer
- int *ap[]; // array ‘ap’ of pointers to an integer
int *fp(); // function ‘fp’ which returns a pointer to an integer
int ***ppp; // pointer ‘ppp’ to a pointer to a pointer to an integer
- int (**ppa)[]; // pointer ‘ppa’ to a pointer to an array of integers
- int (**ppf)(); // pointer ‘ppf’ to a pointer to a function with return value of type integer
- int *(*pap)[]; // pointer ‘pap’ to an array of pointers to an integer
- int *(*pfp)(); // pointer ‘pfp’ to function with return value of type pointer to an integer
- int **app[]; // array of pointers ‘app’ that point to pointers to integer values
- int (*apa[])[]; // array of pointers ‘apa’ to arrays of integers
- int (*apf[])(); // array of pointers ‘apf’ to functions with return values of type integer
- int ***fpp(); // function ‘fpp’ which returns a pointer to a pointer to a pointer to an int
- int (*fpa())[]; // function ‘fpa’ with return value of a pointer to array of integers
- int (*fpf())(); // function ‘fpf’ with return value of a pointer to function which returns an integer
0 0
- C/Cpp指针
- [C++]cpp小笔记3 --- C++数组, 数组指针
- C++-day07-指向对象的指针-student.cpp
- cpp——与c之不同——指针
- c++ 指针,char*[]c,char**cp[],char***cpp
- 变态指针.cpp
- cpp的智能指针
- CPP中的this指针
- 【cpp】引用、指针、const
- cpp学习-指针-1
- Cpp-this指针
- C/C++/CPP中与虚拟存储器(指针)有关错误汇总(一)
- C/C++/CPP中与虚拟存储器(指针)有关错误汇总(二)
- C/C++/CPP中与虚拟存储器(指针)有关错误汇总(一)
- C/C++/CPP中与虚拟存储器(指针)有关错误汇总(二)
- C/CPP点滴积累—数组做函数参数退化为指针
- cpp反汇编之指针
- [C++]PSAPIDEM.CPP
- Linux远程使用图形界面
- power_saving导致的负载过高[已解决]
- Unity各种路径
- data factory快速生成大批量数据
- 函数篇之2——匿名函数
- C/Cpp指针
- 一个正则表达式测试(只可输入中文、字母和数字)
- MVC模式详解
- XmlSerializer序列化
- MySQL数据库引擎介绍、区别、创建和性能测试的深入分析
- Android内存优化大全(全)
- iOS通过URL构建UIImage
- XML中的大于等于号,如何处理
- 浏览器兼容性测试工具