- 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 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 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 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 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: 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: 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: What is encapsulation?

Answer: Encapsulation means wrapping up of Data and Code...this is what i got from data structures book...
Question: what are the differences between member function and constructor?

Answer: Member functions can be invoked only after the creation of objects where as constructors are automatically invoked while creating an object. Constructors used to construct an object i.e, initializing variables in an object during its creation. 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: What is an object?

Answer: Object is a software bundle of variables and related methods. Objects have state and behavior. 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:
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: Which type of questions are asked in interviews?

Answer: what type of question you will get from this site study these question + answer you will get the job very soon Source:
Question: Define parameter by value?

Answer: Pass by value is the default mechanism for passing parameters to a method. The simplest definition of a value parameter is a data type name followed by a variable name. When a method is called, a new storage location is created for each value parameter. The values of the corresponding expressions are copied into them. The expression supplied for each value parameter must be similar to the declaration of the value parameter. Source:
Question: Write a short code using C++ to print out all odd number from 1 to 100 using a for loop

Answer: for( unsigned int i = 1; i < = 100; i++ )<br>if( i & 0x00000001 )<br>cout << i << ","; Source:
Question: What do you meant by static and dynamic modeling?

Answer: Static modeling is used to specify structure of the objects that exist in the problem domain. These are expressed using class, object and USECASE diagrams. But Dynamic modeling refers representing the object interactions during runtime. It is represented by sequence, activity, collaboration and statechart diagrams Source:
Question: What is the difference between class and structure?

Answer: 1:By default,the members of structures are public while that for class is private<br><br>2: strutures doesn't provide something like data hiding which is provided by the classes<br><br>3: structures contains only data while class bind both data and member functions<br> Source:
Question: I am a new computer engineering student can you please explain what is c++ and its uses please answer me this question as faster as you can?

Answer: Well, C++ is an object oriented language in which we make programs using classes and objects and use C++ advantages like inheritance,polymorphisms,dynamic binding etc.. Syntactically, it is similar to C. Well, C and C++ programming is widely adopted in industry and thus every engineering student has the language in his/her curriculum. Source:

1 2 3 4 Next

India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
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
Cache = 0.0625 Seconds