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 the main difference between sizeof() operator in c and c++
What is a scope operator and tell me its functionality?
what is polymorphism?
What is oops concept with example?
What is class and object with example?
What is difference between data abstraction and encapsulation?
What is multiple inheritance?
Does c++ support multilevel and multiple inheritance?
What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass
What is abstraction oop?
if u write a class do u write Assignment operator and copy constructor
What is basic concept of oop?