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
What is the function of multilevel pointer in c?
what is ur strangth & weekness
Explain can static variables be declared in a header file?
Write a code to remove duplicates in a string.
What is the role of && operator in a program code?
Is using exit() the same as using return?
How does sizeof know array size?
What is new line escape sequence?
What is indirection? How many levels of pointers can you have?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
what are the 10 different models of writing an addition program in C language?
Explain can you assign a different address to an array tag?
What is auto keyword in c?
Is it possible to pass an entire structure to functions?
With the help of using classes, write a program to add two numbers.