Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Rules of Operator Overloading
Regular Function in a class
class SI
{float i,p,n,r,a;
public:
SI(){};
SI(int gp,int gn, int gr);
void putdata(void);
SI sum(SI, SI);
};
SI SI::sum(SI i1, SI i2)
{SI i3; i3.p=i1.p+i2.p; i3.i=i1.i+i2.i; i3.a=i1.a+i2.a; return i3;
}
void SI::putdata(void)
{cout<<"Principle is: "<
SI::SI(int gp,int gn, int gr){
p=gp;n=gn;r=gr; i=(p*n*r)/100; a=p+i;
int main()
{ SI i1,i2,i3;
i1=SI(1000,2,10); i1.putdata(); cout< return 0; }
return 0;
Q: Name the operators which cannot be overloaded? A:sizeof, ., .*, .->, ::, ?:
A: it is containing and hiding Information regarding an object, like internal data structures and code. It isolates the internal complication of an object's operation from the res
Scope Resolution operator: The scope resolution operator: : is used to access global variable in the inner block. When global and local variable are identical name the scope re
There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that
Use of random function: int main(void) { int i,j; for(j=0;j { // randomize(); for(i=0;i printf("%d\n", ran
Add a function for saving the text stored in an array to a file. Your program must check whether or not the output file already exists, and if it does, your program must ask the us
How to write a global inline function First, let's get away from member functions for a moment and consider a global function. To make a request that this function be in line:
Introduction to Classes Object-oriented programming (OOP) is a conceptual approach to design programs. It can be executed in many languages, whether they directly support OOP c
Write a program to get the largest element in an array using Function? # include int largest(int b[],int); main() { int lar,a[5]={12,2,36,40,5}; lar=largest(a,n); printf("
Program1: Write a program to find the factorial of a given number. The input is user given. Final output is printed out on to the screen. Program2: Write a program to gene
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd