指针数组和数组指针的使用
2016-10-21 19:07
197 查看
代码:
测试:
![](https://img-blog.csdn.net/20161021190517316)
分析:
#include <iostream> using namespace std; int main() { char *str[] = { "Welcome", "to", "Fortemedia", "Nanjing" }; char **p = str + 1; str[0] = (*p++) + 2; str[1] = *(p + 1); str[2] = p[1] + 3; str[3] = p[0] + (str[2] - str[1]); cout << str[0] << endl; cout << str[1] << endl; cout << str[2] << endl; cout << str[3] << endl; cout << endl; system("pause"); return 0; }
测试:
分析:
相关文章推荐
- 使用快速排序算法对字符串数组进行排序(复习指向指针的指针以及指针数组的使用)
- 指针数组和数组指针的使用
- 指针数组与数组指针的使用
- 指针数组和数组指针的使用
- 数组指针和指针数组的使用
- C语言指针数组使用案例【二级指针之指针数组】
- 指针数组和数组指针的使用
- 【指针数组和数组指针的使用】
- 关于指针数组和数组指针的一点心得!
- 读帮助文档发现Delphi2009的新特性,象C语言一样用数组方式使用指针.
- 指针数组和数组指针的区别
- 指针数组,数组指针,指针函数,函数指针的区别及类型间的转换
- 数组指针和指针数组
- 函数指针数组的应用,但在类内作为成员使用,需要特殊处理,指针类型要匹配
- 使用指针来将多维数组传递给函数
- 指针数组与数组指针
- c#中使用数组指针
- 指针数组与数组指针,一切都是指针问题
- 使用指针复制字节数组
- 指针数组和数组指针