????????C++?????????????????????????????????????????????????潫????????????????????????????????????????????????????
??????????????
?????????????????????????????????????????????????????????
????????????????????
?????????????????????????洢?????????????????(?????)???????????????????????????????????????????????????????????洢???
???????????????????????????????????????????棬???????????????????????????????????????????????????????????????????????????????????????????????????????檔
??????????????
????????Type& name = var;
????????1??????????????????????????????????г????
????2???????????????????????????г?????????潫???????????????????
???????????????
????1???????????????????????????????????Щ?????????????
????2????????????????????и??????????????
?????????java?????????????????????????????????C++?е?????????????????????????????
?????????????????????????????
????1?????????????????????????
????int main()
????{
????int a = 1;
????//int& b;   C++???????????????“b”??????????????-->??????????????
????int& b = a;
????}
????????? ????????????–>??????????????
????2???????????????????????
struct teacher
{
int age;
//4?????
teacher& m_techer;
};
struct student
{
int age;
//4?????
short& weight;
};
int main()
{
cout???m_techer??
?????4?????*/
cout???weight????
???4?????*/
system("pause");
return 0;
}
???????????????teacher&??short&????????????????4??????32λ???????????????????????????
????????1??2????????????????????????????????????????????????????
????3????????????????? ?????????
????int main()
????{
????int a =10;
????int m = 22;
????int& b = a;
????&b = &m;
????/*?????  b???????????????????????????????????&b
????????????????????????????????????????????????????????????*b??
??????????? “=”: ???????????????-->?????????????????????
?????????????*/
????system("pause");
????return 0;
????}
???????????????????????????????C++?????????????C??????????????????????
????4??C++????????C????????????????????