+ 1
Can u explain me what is call by reference???
n plzz Make a program so i can easily understand through it?
7 Answers
+ 3
void valueFunc (int a) // pass by value
{
a = 10; // a is a local variable here
}
void refFunc (int &a) //pass by reference
{
a = 5; // a is the variable outside of the function
}
int a = 5;
valueFunc(a);
cout << a; //outputs 10
refFunc(a);
cout << a; //outputs 5
+ 1
What do you mean with impure function ?
In addition to chris
I made some code in c#.
If you call by reference the value of the variable can be changed by the method
If you call by value, you are passing the value to method, but this method cannot change the variable outside the method
https://code.sololearn.com/c1ouEB3cNpPm
+ 1
Nope. I do not have knowledge of java. Why is c# i your tags ?
0
plzzz use impure function??
0
i mean make a progran with java that has call by reference....plzzz dont use c# etc.....make with impure function or mutator method!!
0
sorry for that!!! but i want a program in java....
- 1
plzz anyone make this program???