C++ Question Bank 2
C++ Question Bank 2
1. What is inline function? What is its use? In what situations inline functions are not
recommended?
2. What is friend function? Explain its need in object oriented programming. OR What is
friend function? Explain with suitable example OR What is friend function? How a
3. Explain the use of static function in a class with example. OR Explain static variable and
static function.
4. Write a class “student” with roll number, name, qualification, course name and fees.
Define a method to display student information. Declare array of 5 objects of the class.
5. Define static data. Explain how static variables are declared and used.
6. What are C-type strings? How are they different from strings defined by standard C++
string class?
1) Inline function
3) Types of pointer
9. Write a program to convert a distance from meter to centimeter and centimeter to meter