what is the difference between call by value and call by
reference?
Answer Posted / mahesh
call by value
int fun(int a,int b);
int fun(int p,int q)
{
temp=p;
p=q;
q=temp;
}
call by reference
int fun(int &a,int &b);
int fun(int *a,int *b)
{
temp=*a;
*a=*b;
*b=temp;
}
call by value is with values n call by ref with adresses n
pointers...
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Which is better pointer or array?
Explain how can a program be made to print the line number where an error occurs?
What does %p mean c?
What is a program flowchart and how does it help in writing a program?
Which type of language is c?
What is a function in c?
What is pointer to pointer in c language?
can we have joblib in a proc ?
What does stand for?
What is the meaning of && in c?
What is the collection of communication lines and routers called?
Why is sprintf unsafe?
What is an array? What the different types of arrays in c?
If I have a char * variable pointing to the name of a function ..
What is the scope of global variable in c?