Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Example of friendly function in c++

Answers were Sorted based on User's Feedback



Example of friendly function in c++..

Answer / harry0009

#include<iostream.h>
class sample
{
int a,b;
public:
void setvalue()
{
a = 25;
b = 45;
}
friend float mean(sample s);
};
float mean(sample s)
{
return(float(s.a+& b)/20);
}
void main()
{
sample ;
x.setvalue
cout<<"mean value"<<mean(x);
getch();
}

Is This Answer Correct ?    11 Yes 4 No

Example of friendly function in c++..

Answer / guest

friend

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More C Interview Questions

Explain high-order bytes.

0 Answers  


HOW DO YOU HANDLE EXCEPTIONS IN C?

2 Answers   AppLabs,


difference between c and c++?

2 Answers  


What is a Deque?

2 Answers  


What is the time and space complexities of merge sort and when is it preferred over quick sort?

0 Answers   Amazon,


Given an array of length N containing integers between 1 and N, determine if it contains any duplicates.

3 Answers   SilverKey,


write a program of bubble sort using pointer?

3 Answers   TCS,


what will be the output of" printf("%d%d",scanf("%d% d",&a&b));"

4 Answers  


What is a protocol in c?

0 Answers  


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

0 Answers  


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

0 Answers  


what is c language.

3 Answers  


Categories