what is code for call by value and call by reference?
Answer Posted / anilkumar.s
#include<iostream.h>
class call
{int a,b;
void callbyvalue(int x,int y)
{ a=x;
b=y;
int c;
c=a;
a=b;
b=c;
}
void callbyreference(int *x,int *y)
{
a=x;
b=y;
int *t;
t=a;
a=b;
b=t;
}
void display()
{
cout<<" a=" <<a<<" "<<"b="<<b;
}
void main()
{
call o;
o.callbyvalue(10,20)//value can't be swap
o.callbyreference//value can be swaP
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is polymorphism and types?
What does and I oop mean?
Why is encapsulation used?
How do you define social class?
What is multilevel inheritance in oop?
Plese get me a perfect C++ program for railway/airway reservation with all details.
Can main method override?
What is encapsulation in ict?
Can destructor be overloaded?
Can we create object of interface?
What is polymorphism programming?
what is difference between class template and template class?
What does no cap mean?
What is the importance of oop?
What is constructor overloading in oop?