What is friend function?

Answer Posted / kumarasamy

it is nonmember function of class it can access the
private and protected members in the class, And it is
defined by a keyword frind.........

Is This Answer Correct ?    36 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the real life example of polymorphism?

605


Why do while loop is used?

575


What is class and example?

568


Why do we use oop?

605


write a program to find 2^n+1 ?

1549






#include #include #include #include void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

3247


What is constructor overloading in oop?

607


What is the purpose of enum?

581


is there any choice in opting subjects like 4 out of 7

1729


What does enum stand for?

613


2. Give the different notations for the class.\

1588


What are the types of abstraction?

555


What is abstraction oop?

623


Where is pseudocode used?

563


Can enum be null?

587