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!
Using a Friend
Using a friend function is quite easy. The following example explains a friend function to access members of two classes.
class Bclass; // Forward Declaration
class Aclass
{
public :
Aclass(int v)
Avar = v;
}
friend int addup(Aclass &ac, Bclass &bc);
private :
int Avar;
};
class Bclass
Bclass(int v)
Bvar = v;
int Bvar;
int addup(Aclass &ac, Bclass &bc)
return( ac.Avar + bc.Bvar);
void main()
Aclass aobj;
Bclass bobj;
int total;
total = addup(aobj,bobj);
Pawnbroker software to be written in VB Project Description: I want software written for my pawnshop. I am currently using a program called pawnboss but would like to have my
A: Use a member while you can and a friend when you need to. Sometimes friends are better syntactically (e.g., in class Fred, friend functions let the Fred parameter to be secon
Explain about the Character Constants in c language? The character constant is a single alphabet and a single digit or a single special symbol enclosed within a pair of single
Addition of array elements: #define rows 3 #define cols 3 void main() { int i=0,j=0,sum=0; int arr[rows][cols];
Program is to check whether the string entered is a palindrome or not: Program is to check whether the string entered is a palindrome or not invoke function from main int p
Reusability Reusability means reusing code written earlier, may be from some earlier project or from the library. Reusing old code not only saves development time, but also sa
Question 1 Describe the theory behind class templates and function templates along with relevant programming examples Question 2 With the help of suitable programming example
color representation 0,1,2,3,4,5,6,7,.......
how many values we can return from pointer to function?
Question 1 What is function overloading? Write a c++ program to implement a function overloaded Question 2 Explain about the constructors and Destructors with suitable exampl
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: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd