Lesson 8 of 24
References మరియు Pass by Reference
9 min 30 XP
Reference (int& r = x) ఒక variable కు మరో పేరు. Parameter ను reference చేస్తే function pointers లేకుండానే caller variable ను మార్చగలదు. పెద్ద objects ను copy చేయకుండా పంపడానికి const& వాడండి.
Example: edit me and press Run
Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.Pointer vs reference: reference null కాలేదు, మరో variable వైపు మళ్ళించలేము. ప్రసిద్ధ interview ప్రశ్న.