对引用与指针使用以及函数返回引用与指针类型理解.docVIP

  • 3
  • 0
  • 约3.59万字
  • 约 6页
  • 2017-08-06 发布于河南
  • 举报

对引用与指针使用以及函数返回引用与指针类型理解.doc

对引用与指针使用以及函数返回引用与指针类型理解

引用的符号是,指针的符号是* 先来看看一段测试代码, 1: #include stdafx.h 2: #include iostream 3: using namespace std; 4: int globalJ =999; 5:? 6: //返回值 7: int test1() 8: { 9: int j =1; 10: coutin test1(),[return value] the varaible js address :jendl; 11:? 12: return j; 13: } 14:? 15: //使用局部变量,返回引用 16: int test2() 17: { 18: int j =998; 19: coutin test2(),[use field variable and return reference] the local varaible Js address :jendl; 20: coutin test2(),[use field variable and return reference] the local varaible Js value :jendl; 21: 22: retur

文档评论(0)

1亿VIP精品文档

相关文档