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?



what is code for call by value and call by reference?..

Answer / 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

More OOPS Interview Questions

Pls...could any one tell me that whether we can access the public data memeber of a class from another class with in the same program. Awaiting for your response Thanku

4 Answers  


What is pointer in oop?

0 Answers  


when my application exe is running nad i don't want to create another exe what should i do

2 Answers   HCL,


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

0 Answers  


can inline function declare in private part of class?

1 Answers  


Can we have a private constructor ?

12 Answers   HSBC, Ness Technologies, TCS, Wipro,


How do you achieve runtime polymorphism?

0 Answers  


Is oop better than procedural?

0 Answers  


What is inheritance in simple words?

0 Answers  


tell about copy constructor

3 Answers   Siemens,


what is the drawback of classical methods in oops?

0 Answers  


Why do we use encapsulation in oops?

0 Answers  


Categories