C++ return Keyword
Example
int myFunction(int x) {
return 5 + x;
}
int main() {
cout << myFunction(3);
return 0;
}
Definition and Usage
The return
keyword finishes the execution of a function, and can be used to return a value from a function.
Related Pages
Read more about return values in our C++ Functions Tutorial.