- World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.

Get it now !!
Send your Resume to 6000 Companies
C++ Basics Interview Questions & Answers - Learning Mode

C++ Basics Interview Questions & Answers - Learning Mode

C++ is a general-purpose programming language. C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features.

Try C++ Basics Interview Questions & Answers - Exam Mode

1 2 3 4 Next

Sort By : Latest First | Oldest First | By Rating

C++ Basics Interview Questions & Answers - Learning Mode
Try C++ Basics Interview Questions & Answers - Exam Mode
Question: What is the difference between an object and a class?

Answer: Classes and objects are separate but related concepts. Every object belongs to a class and every<br>class contains one or more related objects.<br><br>?A Class is static. All of the attributes of a class are fixed before, during, and after the execution of<br>a program. The attributes of a class don't change.<br><br>?The class to which an object belongs is also (usually) static. If a particular object belongs to a<br>certain class at the time that Source:
Question: What is the difference between class and structure?

Answer: Structure: Initially (in C) a structure was used to bundle different type of data types together to<br>perform a particular functionality. But C++ extended the structure to contain functions also. The<br>major difference is that all declarations inside a structure are by default public.<br><br>Class: Class is a successor of Structure. By default all the members inside the class are private. Source:
Question: What is Difference between c and c++?

Answer: C is a structured programming language where as C++ is an object oriented language. C++ is also called as C with Classes. Source:
Question: What is prototype in c++ and c?

Answer: Prototype is a model that can explain the structure of the functions we are going to use in our C and C++ programs.Suppose we are going to use one function called add with two parameters to add means the prototype of the function is int add(int a,int b), simply prototype in C and C++ is the function declaration. Source:
Question: What are the different types of Storage classes?

Answer: There are four types of storage class: automatic, register, external, and static Source:
Question: In c++ have a default constructor ?

Answer: Yes C++ does have a default constructor provided by the compiler.In this case all the members of the class are initialized to null values.These values act as the default values.For eg: MyClass me;In the above case since the object is not initialized to any value so the default constructor will be called which will initialize the class with the default values. Source:
Question: Difference between "C structure" and "C++ structure".

Answer: They are different. C struct can only contain data while C++ struct can contain functions and access limitation such as public, private etc just as a class (not totally the same as class!) Source:
Question: What is class?
What is object?
Describe these 2 with example.

Answer: Group of objects is called a class.<br>Instance of class is called a object. Source:
Question: What is the return value for getch()?

Answer: getch() function is specified in Conio.h header file, and gets a character from the keyboard.<br>Its prototype is:<br> int getch(void);<br><br>It obtains a character from stdin. Input is unbuffered, and this routine will return as soon as a character is available without waiting for a carriage return. The character is not echoed to stdout. Source:
Question: What is the definition of abstract class and virtual function?

Answer: A class which have abstract methods with no implementations.You can't create object for this class.
virtual function:
If u override a member function in base class and derive class or if u want to achieve the runtime polymorphisms then we have to declare base class function as virtual function.This function called by base class pointer. Source:
Question: Why can't one make an object of abstract class?Give compiler view of statement

Answer: we cant make object of abstract class becoz, in the vtable the vtable entry for the abstract class functions will be NULL, which ever are defined as pure virtual functions...

even if there is a single pure virtual function in the class the class becomes as abstract class..

if there is a virtual function in your class the compiler automatically creates a table called virtual function table .. to store the virtual function addresses.... if the function is a pure virtual function the Source:
Question: What are the things contains in .obj file ? ( compiled result of .cpp file )

Answer: C++ .obj file holds code and data suitable for linking with other object files to create an executable or a shared object file.

Question: what is the difference between c&c++?

Answer: There are many differences between c and c++ but some of the important are 1.A small but potentially important difference between c and c++ is that in c a character constant is automatically elevated to and integer whereas in c++ it is not.2.In c we can declare the global variable several times eventhough it is a bad programming concept but in c++ it is an error.3.Another subtle difference between c and c++ is that in c++ all functions must be prototyped.Remember in c prototypes are recommended Source:
Question: Define a constructor - What it is and how it might be called (2 methods).

Answer: constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized.

Ways of calling constructor:
1) Implicitly: automatically by complier when an object is created.
2) Calling the constructors explicitly is possible, but it makes the code unverifiable. Source:
Question: What is an object?

Answer: Object is a software bundle of variables and related methods. Objects have state and behavior. Source:
Question: what are the differences between c and c++? If possible give more points.
what are the disadvantages of C++?

Answer: The syntax of C++ is a lot like C, with various extensions and extra keywords needed to support classes, inheritance and other OO features. Source:
Question: What is encapsulation?

Answer: Encapsulation means wrapping up of Data and Code...this is what i got from data structures book...
Question: What is an enumerator?

Answer: Enumeration is a value data type, which means that enumeration contains its own values and cannot inherit or pass inheritance. Enumerator allows you to assign symbolic names or integral constants. Source:
Question: What are the advantages of OOPL?

Answer: Object oriented programming languages directly represent the real life objects. The features of OOPL as inheritance, polymorphism, encapsulation makes it powerful. Source:
Question: why c++ is called as object-oriented language? Here what does object mean?

Answer: C++ treats data as a critical element during the program development and does not allow the data to flow freely across the program. In C++ data can be accessed only through objects and C++ allows to decompose the program into number of entities called objects where each object can build its own functions and data on these entities. Source:

1 2 3 4 Next

India News Network
Latest 20 Questions
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
"Holiday Packages" announced as an advertisement are an example of _________: (a) Offer (b) Counter Offer (c) Invitation to Offer (d) None of the above
A match fixing contract between a player and a broker is a: (a) Valid Contract (b) Unenforceable Contract (c) Void Contract (d) Illegal Contract
When a bookseller sells a book on cash payment then it is called as ___________: (a) Unilateral Contract (b) Bilateral Contract (c) Executed Contract (d) Executory Contract
____________ agreements are created by situation: (a) Written (b) Oral (c) Void (d) Implied
Cache = 0.03125 Seconds