int *p[]与int (*p)[]
来源:互联网 发布:舵机机械臂随动编程 编辑:程序博客网 时间:2024/05/03 17:29
int *p[2];是一个指向int的指针数组,即每个元素都是一个指针
#include <string>#include <iterator>#include <iostream>#include <algorithm>using namespace std;int main(){int a[] = {1,2,3,4,5};int b[] = {10,20,30,40,50};int *p[2];p[0] = a;p[1] = b;for(int i = 0; i < 5; i++)cout << *p[0] + i << endl;for(int i = 0; i < 5; i++)cout << *p[1] + i << endl;}
int (*p)[2]是指向两个元素的指针
#include <iostream>using namespace std;void main() {int (*p)[2];int b[3][2] = {{1, 2}, {3, 4}, {5, 6}};p = b;for(int i = 0; i < 3; i++) {for(int j = 0; j < 2; j++) cout << p[i][j]; //cout << *(*(p+i)+j);cout << endl;}}
- int *p[]与int (*p)[]
- int *p[] 与 int (*p)[]
- int*p与int **p的用法
- int* p 与 int** p的区别
- int *p[] 与int (*p)[] 的区别
- int*p[ ]与int(*p)[ ]的不同
- int*p[ ]与int(*p)[ ]的不同
- int * const p 与 const int *p
- int *&p与int *P的区别
- int*p[ ]与int(*p)[ ]的不同
- int *const p 与 const int *p
- const int *p与int *const p
- int *const p与int const *p与const int *p与const *int p
- int **p 、int (*p)() 、 int (*p)[5] 和int (**p)()
- int **p
- C语言指针 int *p[10] int (*p)[10] int *p(int) int (*p)(int) 区别与举例
- int(*p)[]和int(**p)[]
- int(*p)[]和int(**p)[]
- 使用python测测你的系统最多能创建多少个线程
- IBUS ImportError: No module named gtk
- Oracle SqlLoader 用法
- LeetCode: Spiral Matrix
- 循序渐进PostgreSQL: 学习pqxx C++ API访问
- int *p[]与int (*p)[]
- java之jvm学习笔记十一(访问控制器)
- LeetCode : Spiral Matrix II
- 关于main函数中argc和argv的简单介绍
- MAYA 创建脚本节点 自定义右键菜单
- Ognl,Context,ValueStack详解
- GUI演示
- IOS之同步请求、异步请求、GET请求、POST请求
- 批处理删除注册表分支