- 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 encapsulation?

Answer: Encapsulation means wrapping up of Data and Code...this is what i got from data structures book...
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 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 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 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: 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: 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:
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: What is an object?

Answer: Object is a software bundle of variables and related methods. Objects have state and behavior. Source:
Question: What are inner class and anonymous class?

Answer: Inner class : classes defined in other classes, including those defined in methods are called inner classes. An inner class can have any accessibility including private. Anonymous class : Anonymous class is a class defined inside a method without a name and is instantiated and declared in the same place and cannot have explicit constructors. 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: Explain about member functions?

Answer: A function is a set of statements that perform a specific task in response to a message. The functions of a class are called member functions in Csharp. Member functions are declared inside the class. The function declaration introduces the function in the class and the function definition contains the function code. 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 is meant by software development method?

Answer: Software development method describes how to model and build software systems in a reliable and reproducible way. To put it simple, methods that are used to represent ones? thinking using graphical notations. Source:
Question: Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE

Answer: class SHAPE{
public virtual Draw() = 0; //abstract class with a pure virtual method

class CIRCLE{
public int r;
public virtual Draw() { this->drawCircle(0,0,r); }

class SQURE
public int a;
public virtual Draw() { this->drawRectangular(0,0,a,a); }

Each object is driven down from SHAPE implementing Draw() function in its own way. Source:
Question: Can constructors & destructor be virtual ?

Answer: Destructor can be virtual.
Constructor can not but the principle of virtual constructor can be achieved by Clone operation. Source:
Question: What is C++?

Answer: Released in 1985, C++ is an object-oriented programming language created by Bjarne Stroustrup. C++ maintains almost all aspects of the C language, while simplifying memory management and adding several features - including a new datatype known as a class (you will learn more about these later) - to allow object-oriented programming. C++ maintains the features of C which allowed for low-level memory access but also gives the programmer new tools to simplify memory management.<br><br>C 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.03125 Seconds