[求助]字符串
char s[]="123\t456\00089",*p=s;
cout<<*(p+5)<<endl;
cout<<(p+5);
输出结果为什么是5和56呀~高手解释下哦~
char s[]="123\t456\00089",*p=s;
cout<<*(p+5)<<endl;
cout<<(p+5);
输出结果为什么是5和56呀~高手解释下哦~
char s[]="123\t456\00089",*p=s; //p指向s的第一个字符
cout<<*(p+5)<<endl; //p做+5运算再解引用,123\t45(012345)得5
cout<<(p+5); //输出从当前指针指向的字符到\0(空字符)的字符串,得56
输出结果为什么是5和56呀~高手解释下哦~