C++ Interview Questions
Questions Answers Views Company eMail

How do you compile the source code with your compiler?

826

What are the two types of comments, and how do they differ?

816

If there are two catch statements, one for base and one for derived, which should come first?

791

If a function doesn’t return a value, how do you declare the function?

833

If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?

837

What is the difference between the parameter to a template and the parameter to a function?

920

How many static variables are created if you put one static member into a template class definition?

786

When is the copy constructor called?

910

What does new return if there is insufficient memory to make your new object?

817

How do you establish a has-a relationship?

842

Show the declaration for a pointer to function returning long and taking an integer parameter.

826

Is it legal in c++ to overload operator++ so that it decrements a value in your class?

848

How do you invoke a base member function from a derived class in which you have not overridden that function?

887

What is an inclusion guard?

882

Where must the declaration of a friend function appear?

758


Un-Answered Questions { C++ }

when to use 'mutable' keyword and when to use 'const cast' in c++

1907


What c++ library is string in?

816


What is oops in simple words?

828


What is heap sort in c++?

878


int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}

1054


Where must the declaration of a friend function appear?

758


Differentiate between late binding and early binding. What are the advantages of early binding?

823


What are destructors?

770


What is enum class in c++?

965


How many namespaces are there in c++?

796


What is a null object in c++?

869


What is the use of this pointer in c++?

817


Differentiate between the message and method in c++?

843


What is the purpose of template?

863


What is the difference between reference and pointer?

871