adspace


What do you understand by friend-functions? How are they used?

Answer Posted / Rahul Harshawardhan

"Friend functions are non-member functions that have access to private and protected members of a class in C++. They are defined outside the class definition and can be used for performing operations on objects without being a member of the class. Friend functions are useful when it is necessary to write a function that requires direct access to the private or protected members of a class, but doesn't need to be associated with any specific object.".

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i have a written test for microland please give me test pattern

2814


ATM machine and railway reservation class/object diagram

5337


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2260


swap 2 numbers without using third variable?

1211


What are compound statements?

1292


What is dynamic dispatch in c++?

1140


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2829


Explain the difference between null pointer and void pointer.

1160


How do you convert strings to numbers in C?

1346


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

2400


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1361


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2216


Do you know the difference between malloc() and calloc() function?

1135


What is the general form of a C program?

1100


How do you determine the length of a string value that was stored in a variable?

1205