Pointer
注意事项
#include<iotream>
#include<string>
using namespace std;
公寓大楼 内存卡
房间 内存空间 内存地址(房间号)
int main()
{
int a=324;
int b=100;
string str="sdluxncjdnchsdvhjcbsnxndjbj";
cout<<str<<endl;
//指针可以访问变量的内存地址
//指针就是用来存储某个变量的内存地址的
//int* pA;//int * pA;int *pA;
//pA = &a;
int* pA=&
cout<<pA<<endl;
pA=&b;
cout<<pA<<endl;
cout<<*pA<<endl;//*取得后面的(指针)内存地址所指向的数据(所存储的数据)
*pA=300//b=300
cout<<b<<":"<<*pA<<":"<<pA<<endl;
void* p1= &str; p1= &a;
cout<<*((omt*)p1)<<endl;
int* p2=NULL;
p2= &a;
string s;
cin>>s;
return 0;
}