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 Class in oops with example?
Write a program to reverse a string using recursive function?
write a program for function overloading?
14 Answers HCL, InfoCity, TATA,
wht is ditch
What is the main purpose of inheritance law?
design class for linked list and include constructor,destructor,insert option. node of form struct node { int data; struct node &ptr; }
When is it necessary to use member-wise initialization list in C++?
what is the difference between inter class and abstract class...?
How to hide the base class functionality in Inheritance?
What is encapsulation in simple terms?
program for insertion ,deletion,sorting in double link list
how to find the correct email address format by using the programe?