Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Return by Reference in User-defined Functions of Programming in CPP
1144 Views
Usage 
Return by reference method can be used to return the value by reference.
Example
#include <iostream>
using namespace std;
int b;
int& value();

int main() {
    value() =9;
    cout<<"value of b"<<b;
    return 0;
}

int& value() {
    return b;
}
Output 
value of b: 9
Next Topics
Next lessons of current book.
User-defined Functions of Programming in CPP
User-defined Functions of Programming in CPP
Math Library Functions of Programming in CPP
Math Library Functions of Programming in CPP
Math Library Functions of Programming in CPP
Previous Topics
Previous lessons of current book.
User-defined Functions of Programming in CPP
Best Lessons of "Programming in CPP"
Top lessons which are viewed more times.
String Class in CPP of Programming in CPP
Math Library Functions of Programming in CPP
Math Library Functions of Programming in CPP
String Class in CPP of Programming in CPP
User-defined Functions of Programming in CPP
Math Library Functions of Programming in CPP
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details