+ 1

Can u explain me what is call by reference???

n plzz Make a program so i can easily understand through it?

9th Feb 2018, 4:29 PM
Harsh Agrawal
Harsh Agrawal - avatar
7 Antworten
+ 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
9th Feb 2018, 6:49 PM
Chris
Chris - avatar
+ 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
9th Feb 2018, 8:47 PM
sneeze
sneeze - avatar
+ 1
Nope. I do not have knowledge of java. Why is c# i your tags ?
9th Feb 2018, 9:32 PM
sneeze
sneeze - avatar
0
plzzz use impure function??
9th Feb 2018, 6:56 PM
Harsh Agrawal
Harsh Agrawal - avatar
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!!
9th Feb 2018, 9:30 PM
Harsh Agrawal
Harsh Agrawal - avatar
0
sorry for that!!! but i want a program in java....
9th Feb 2018, 9:36 PM
Harsh Agrawal
Harsh Agrawal - avatar
- 1
plzz anyone make this program???
10th Feb 2018, 4:39 AM
Harsh Agrawal
Harsh Agrawal - avatar