使用VC2008.

#include<iostream>
using namespace std;
int main()
{
cout<<"hello"[0]<<"hello"[1]<<"hello"[2]<<"hello"[3]<<"hello"[4]<<"的长度是:"<<sizeof("hello")<<endl;
cout<<"hello[0]的地址是:"<<&"hello"<<endl;
cout<<"hello[1]的地址是:"<<&("hello"+1)<<endl;

const char *p=&"xhello"[1];
cout<<p<<endl;

return 1;
}

输出结果:

hello的长度是:6

hello[0]的地址是:00247878

hello[1]的地址是:00247879

hello

相关文章:

  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
  • 2021-12-04
  • 2021-08-14
  • 2021-06-07
  • 2022-01-01
相关资源
相似解决方案