- Passing by reference allwos a called functioto access variables in the calling fucntion. C++'s addition of the feature is a bread from C, whice only passes by value. Passing by value, recall, results in the called function working with copies of values from the callinig program. Of course, C lets you get around the passing by value limitation by using pointers.
- You should initialize a reference variable when you declare it.
- A reference is rather like a const pointer.
06-30
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交