- Get link
- X
- Other Apps
Call by value or reference - There are two type in function call by value or call by reference in it we pass the value in call by value we pass value and in call by reference we pass the reference of the value . Call by value in C++ Programming language :- In call by value we pass the variable or say argument and then it used by function which we made so see the code given below Syntax - #include <iostream > using namespace std; // making function void fun_name(int a, int b) { ... } int main() { //calling function fun_name(int n,int n1); return 0; } Code - // function call by value in C++ programming #include <iostream> using namespace std; // call by value in function declaration void container(int a, int b); int main() { int x,y; cout<<"Enter the value of x :"<<endl; cin>>x; cout<<"Enter the value of y :"<<endl; cin>>y; // here we passing the value as argument // and also calling the function