0% found this document useful (0 votes)
2 views

C++ Programming questions

The document consists of a series of questions related to C++ programming concepts, covering topics such as access specifiers, message passing, stream manipulators, constructors, object-oriented programming, polymorphism, inheritance, and memory management. It also includes comparisons between various programming constructs and discusses the Standard Template Library (STL) and exception handling. Each question prompts for explanations, definitions, and examples to illustrate the concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

C++ Programming questions

The document consists of a series of questions related to C++ programming concepts, covering topics such as access specifiers, message passing, stream manipulators, constructors, object-oriented programming, polymorphism, inheritance, and memory management. It also includes comparisons between various programming constructs and discusses the Standard Template Library (STL) and exception handling. Each question prompts for explanations, definitions, and examples to illustrate the concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1. What is an access specifier? Explain different types of access specifiers available in C++.

2. What is message passing?

3. What is a stream manipulator? Explain the use of setw() and setprecision().

4. What is a constructor? Explain how a constructor is overloaded in C++.

5. What is object-oriented programming? Give two advantages of object-oriented programming over


structured programming.

6. How does a virtual function differ from a pure virtual function?

7. Explain the association of dynamic binding and runtime polymorphism, with a suitable example.

8. Explain the concept of inline function in C++.

9. What is the difference between function overloading and function overriding in C++? Explain the usage
of these concepts.

10. What is inheritance? Explain different types of inheritance in C++.

11. Differentiate between the following:

Binary file and Text file

get() and getline()

12. What is a stream in C++? Name the streams generally used for file I/O.

13. What is the difference between a keyword and an identifier? Explain with an example.

14. What is the purpose of exception handling? Explain how an exception is handled in C++.

15. What are the essential properties of object-oriented programming? How does object-oriented
programming differ from structured programming?
16. What do you understand by the scope of a variable? Compare global variable and local variable in
C++.

17. Compare structures and classes in C++. What are empty classes? Explain the purpose of empty
classes.

18. What are static members of a class? What is the utility of having static members?

19. What are constructors? Write the characteristics of a constructor. What are the limitations of a
constructor?

20. What is operator overloading? Why some operators can’t be overloaded?

21. What is Polymorphism? What are the advantages of polymorphism? Mention the types of
polymorphism supported by C++.

22. Briefly discuss the term function overriding.

23. What do you understand by the signature of a method? Briefly discuss the components of the
signature of a method.

24. Compare virtual functions and pure virtual functions.

25. Discuss the taxonomy of C++ data types with a suitable block diagram.

26. What are Breaking Statements? Give syntax of the following breaking statements:

break

continue

goto

exit

27. What is a friend function?

28. Explain copy constructor with the help of an example program.


29. Discuss the role of “new” and “delete” as memory management operations.

30. Explain the role of destructors in C++ memory management.

31. Explain the access specifiers used in inheritance in C++.

32. Compare multiple inheritance with multilevel inheritance and hierarchical inheritance.

33. What is STL? Briefly discuss the components of STL.

34. Write short notes on the following:

File Stream Operations

Inline Functions

Exception Handling

Class Templates

Function Templates

You might also like