字符串数组与指针问题??
来源:互联网 发布:windows未能启动成功 编辑:程序博客网 时间:2024/04/20 00:31
#include<iostream>using namespace std;int main(){char s[]="abcd";char *p;p=s;for (int i = 0; i < 4; i++){ cout<<*(p++)<<endl;}for ( p = s; p < s+4; p++){ cout<< cout<<p<<endl;}for (int i = 0; i <=3; i++){ cout<<s[i]<<endl;}system("pause");return 0;}
输出是:a
b
c
d
abcd
bcd
cd
d
a
b
c
d
不明白的地方就是第二个程序为什么输出的是:abcd bcd cd d??
0 0
- 字符串数组与指针问题??
- 字符串数组与指针
- 字符串数组与指针
- 数组、指针与字符串
- 数组、指针与字符串
- 数组、字符串与指针
- 字符串数组与指针
- 字符串数组与字符串指针
- 字符串指针与字符串数组
- 讨论: 字符串数组与字符串指针数组
- 字符串指针与字符数组
- 字符串指针与字符数组
- 字符串指针 与 字符数组
- 字符串与指针,数组名
- 字符数组与字符串指针
- 字符串指针与字符数组
- 字符串与数组和指针
- 数组 指针与字符串
- 更改DOS窗口用户名C:\Users\XXX>
- java+poi解析excel文件
- LinearLayout中控件不能居右对齐
- Android设备的USB通讯
- OC-055.NSData类
- 字符串数组与指针问题??
- Dubbo简介
- MVCC 、CAS 和CopyOnWrite
- Git Reference---Inspection and Comparison
- javascript对象之javascript数组
- DB2 insert语句三种格式
- 四大发明之活字印刷——面向对象思想的胜利
- Spring学习总结(2)——Spring的常用注解
- 未来开发或成智能机器时代—移动终端世纪