挺奇怪的
#include <iostream>
#include <string>
using namespace std;
int main()
{
char ch='t';
cout<<ch<<endl;
cout<<&ch<<endl;
string str="hello";
cout<<&str<<endl;
cout<<str<<endl;
cout<<str[1]<<endl;
char *p="hell0";
cout<<*p<<endl;
cout<<p<<endl;
int i=5;
cout<<&i<<endl;
char cha[]="sdfsdfsf";
cout<<cha<<endl;
cout<<*cha<<endl;
return 0;
}
它们的结果很奇怪。为什么呢???