Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2496


i got a backdoor offer in process global,Bangalore..Can i work with it?

2806


What is the difference between encapsulation and polymorphism?

1062


What is super in oop?

1115


Which type does string inherit from?

1068


Can you explain polymorphism?

1065


What is encapsulation in ict?

1007


Why do we use polymorphism?

1031


What is the purpose of enum?

978


What is difference between multiple inheritance and multilevel inheritance?

1119


Why is object oriented programming so hard?

1040


What is polymorphism explain its types?

1116


Why multiple inheritance is not possible?

1032


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

2098


Can main method override?

1074