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 Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
i got a backdoor offer in process global,Bangalore..Can i work with it?
What is the difference between encapsulation and polymorphism?
What is super in oop?
Which type does string inherit from?
Can you explain polymorphism?
What is encapsulation in ict?
Why do we use polymorphism?
What is the purpose of enum?
What is difference between multiple inheritance and multilevel inheritance?
Why is object oriented programming so hard?
What is polymorphism explain its types?
Why multiple inheritance is not possible?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
Can main method override?