Explain function prototypes in C++.
Answer / Gurmeet Singh
A function prototype is a declaration of a function that provides information about the function's name, parameters, and return type. It helps the compiler to check the correctness of function calls by ensuring they have the appropriate arguments. In C++, function prototypes are typically defined before the implementation of the function.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain the difference between C and C++.
How will you execute a stack using a priority queue? (Push and pop should be in O (1)).
Define namespace.
What are the different scope C++ provide ?
What are the advantages/disadvantages of using inline and const?
What is the difference between public, private, and protected inheritance?
C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.
How do you work around them?
What is Advantage and Use of THIS pointer in C++ – Scenarios?
What is a virtual function in C++?
How does stack look in function calls? Write a recursive function call, how will the stack look like?
What do you know about Volatile keyword in C++? Explain with an example code.