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 |
Pls...could any one tell me that whether we can access the public data memeber of a class from another class with in the same program. Awaiting for your response Thanku
What is pointer in oop?
when my application exe is running nad i don't want to create another exe what should i do
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
can inline function declare in private part of class?
Can we have a private constructor ?
12 Answers HSBC, Ness Technologies, TCS, Wipro,
How do you achieve runtime polymorphism?
Is oop better than procedural?
What is inheritance in simple words?
tell about copy constructor
what is the drawback of classical methods in oops?
Why do we use encapsulation in oops?