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
any one please tell me the purpose of operator overloading
What is overriding in oop?
What is inheritance in oop?
Which language is not a true object oriented programming language?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
What is the use of oops?
What is the important feature of inheritance?
What are the advantages of polymorphism?
What is the purpose of polymorphism?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What does and I oop mean in text?
What does sksksk mean in text slang?
What are the components of marker interface?
What is the diamond problem in inheritance?