Question about Parameter Passing ( Value vs Reference) ?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

abudahim

Thread Starter
Joined
Jul 2, 2005
Messages
507
The following is pseudocode:

Code:
int myArray[] = {11,12,13,14,15,16,17,18,19,20,21,22,23,24};
int m = 2, int n = 3;

void paramPassing(int k, int j){
k = k + 1 + n;
j = j + k + m;
m = m - n;
n = j + m;
}
int main(){
paramPassing(m,myArray[m]);
(2, 13)
K = 2 + 1 + 3
J = 13 + 6 + 2
M = 2 – 3
N = 21

paramPassing(n,n); 

print(m);
print(n);
printArray(myArray);
}
i want to see the difference between passing by value and passing by reference in the specific example.
showing me the steps please.
thank you.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top