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
How oops is better than procedural?
What is encapsulation with example?
What is the real life example of polymorphism?
What causes polymorphism?
Can a destructor be called directly?
Why do we use oops?
Can destructor be overloaded?
What is encapsulation oop?
Why is polymorphism used?
Why do we use polymorphism in oops?
Why do we use inheritance?
What language is oop?
What is pointer in oop?
What is meant by oops concept?
Whats oop mean?