C++ Interview Questions and Answers

C++ is an enhanced version of the C language. C++ includes everything that is part of C and adds support for object- oriented programming (OOP). In addition, C++ also contains many improvements and features that make it a "better C", independent of object oriented programming. C++ is actually an extendible language since we can define new types in such a way that they act just like the predefined types which are part of the standard language. If you just use C++ as a better C, you will not be using all of its power. Like any quality tool, C++ must be used the way it was designed to be used to exploit its richness. Some of the new features include encapsulation, inline function calls, overloading operators, inheritance and polymorphism. I am not going to explain what they mean here as that would simply take me away from my purpose here, but you can refer to any good C++ book or the C++ FAQ for more information.

C++ Language Interviews are getting tough these days as the technology grows faster. To get through the C++ Language interview one needs to update him/herself in a regular manner. Having said that, just before the interview, it is very important to have a quick glance of the reputed C++ Language questions and answers to make yourself comfortable during the interview process. This is where DoAnswers.com helps you in renewing yourself on C++ Language and various other technologies interview preparation.



Next >>

 

1. Can a constructor throw a exception? How to handle the error when the constructor fails?

The constructor never throws a error.


2. Can inline functions have a recursion?

No. Syntax wise It is allowed. But then the function is no longer Inline. As the compiler will never know how deep the recursion is at compilation time.


3. Can you think of a situation where your program would crash without reaching the breakball, which you set at the beginning of main()?

C++ allows for dynamic initialization of global variables before main() is invoked. It is possible that initialization of global will invoke some function. If this function crashes the crash will occur before main() is entered.


4. Define namespace.

It is a feature in C++ to minimize name collisions in the global name space. This namespace keyword assigns a distinct name to a library that allows other libraries to use the same identifier names without creating any name collisions. Furthermore, the compiler uses the namespace signature for differentiating the definitions.


5. Differentiate between a template class and class template.

Template class: A generic definition or a parameterized class not instantiated until the client provides the needed information. It?s jargon for plain templates. Class template: A class template specifies


Your Ad Here

6. Differentiate between the message and method.

Message: Objects communicate by sending messages to each other. A message is sent to invoke a method. Method Provides response to a message. It is an implementation of an operation.


7. does not exist. One common use for a null object is a return value from

a member function that is supposed to return an object with some specified properties but cannot find such an object.


8. does not modify the state of an object. The accessor functions need to

be declared as const operations


9. Explain the ISA and HASA class relationships. How would you implement each in a class design?

A specialized class "is" a specialization of another class and, therefore, has the ISA relationship with the other class. This relationship is best implemented by embedding an object of the Salary class in the Employee class.


10. Explain the scope resolution operator?

It permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.


Your Ad Here

Next >>

 
Databases Questions and Answers
 
DB2 Interview Questions and Answers
IMS Interview Questions and Answers
MYSQL Interview Questions and Answers
Oracle Interview Questions and Answers
PL/SQL Interview Questions And Answers
Quel Interview Questions and Answers
SQL Interview Questions and Answers

 
 
.NET Interview Questions and Answers
 
ASP Interview Questions and Answers
C# Interview Questions and Answers
Visual Basic Interview Questions and Answers
 
J2EE Interview Questions and Answers
 
Enterprise Java Beans (EJB) Interview Questions And Answers
Hibernate Interview Questions And Answers
Jave Messaging Service (JMS) Interview Questions And Answers
Jave Server Faces (JSF) Interview Questions And Answers
Java Server Pages (JSP) Interview Questions And Answers
Servlets Interview Questions And Answers
Spring Framework Interview Questions And Answers
Struts Framework Interview Questions And Answers
 
JAVA Interview Questions and Answers
 
Core Java Interview Questions and Answers
Java Platform, Micro Edition (Java ME) Interview Questions And Answers
JAVA GUI Interview Questions and Answers
Java Performance Tuning Interview Questions And Answers
JUnit Interview Questions And Answers
Remote Method Invocation (RMI) Interview Questions And Answers
Unified Modeling Language (UML) Interview Questions And Answers
 
Java Application Server Interview Questions And Answers
 
Tomcat Application Server Interview Questions And Answers
WebLogic Application Server Interview Questions And Answers
 
Mainframe Interview Questions and Answers
 
CICS Interview Questions and Answers
COBOL Interview Questions and Answers
IMS Interview Questions and Answers
JCL Interview Questions and Answers
REXX Interview Questions and Answers
TELON Interview Questions and Answers
VSAM Interview Questions and Answers
 
Object Oriented Language Questions and Answers
 
C Interview Questions and Answers
C++ Interview Questions and Answers
Eiffel Interview Questions and Answers
J2EE Interview Questions and Answers
JAVA Interview Questions and Answers
Sather Interview Questions and Answers
Small talk Interview Questions and Answers
 
Operation Systems Interview Questions and Answers
 
MS DOS Interview Questions and Answers
Unix OS Interview Questions and Answers
Windows Interview Questions and Answers
 
Scripting languages Interview Questions and Answers
 
Java Script Interview Questions and Answers
Practical Extraction and Reporting Language Interview Questions and Answers
PHP Interview Questions and Answers
VBScript Interview Questions and Answers
 
UserInterfaces Questions and Answers
 
Foxit Interview Questions and Answers
Glade Interview Questions and Answers
Tweak Interview Questions and Answers
 
WEB Technologies Questions and Answers
 
AJAX Interview Questions and Answers
HTML Interview Questions and Answers
WML Interview Questions and Answers
XML Interview Questions and Answers
 
Interview Tips And Some Common Questions
 
Behavioral Interview Questions And Answers


Your Ad Here