<分区>
我正在试验 char 数组,然后尝试运行这个程序:
#include <iostream>
using namespace std ;
int main ( )
{
char *str = "Hello!" ;
cout << &str[0] << endl ;
cout << &str[1] << endl ;
cout << &str[2] << endl ;
cout << &str[3] << endl ;
cout << &str[4] << endl ;
return 0 ;
}
我不断得到这些输出:
Hello!
ello!
llo!
lo!
o!
这里究竟发生了什么?我期待的是十六进制值。