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 data binding in oops?
What is the difference between class and object?
Why do pointers exist?
What is polymorphism give a real life example?
Generally, in all C++ programs, texts are in white colour. Can we change the colour of the text(either input or output or both)? If so, help me out.
What is the use of unnamed namespaces in OOPS? The only advantage I know is that they dont need the scope resolution operator while accessing them. I want to know some other advantages of unnamed namespaces...
what is the difference between virtual function and destoctor?
Is oop better than procedural?
what is virtual function in c++
What is a scope operator and tell me its functionality?
What is persistence in oop?
why in java first invoke public static void main(String args[]) method????Why not public static void method1(String args[])??