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 |
What is Inheritance, Multiple Inheritance, Shared and Repeatable Inheritance?
How can you overcome the diamond problem in inheritance?
There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?
What is a scope operator and tell me its functionality?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What are the 3 principles of oop?
Why we are use # in begning of programme of c++.
What is the renewal class?
what is virtual function?
Can java compiler skips any statement during compilation time?
explain the concepts of oops?
Why do we use inheritance?