Go Back   2023 2024 MBA > MBA > Main Forum

  #1  
Old 8th October 2014, 09:43 AM
Unregistered
Guest
 
Default Important Questions related to C++ with Answers

Can any one here please provide me some of the important C++ Questions with Answer??
Reply With Quote Quick reply to this message
  #2  
Old 8th October 2014, 02:06 PM
Super Moderator
 
Join Date: May 2012
Default Re: Important Questions related to C++ with Answers

As per your request here I am sharing some of the important C++ Questions with Answer

1. What is C++?
C++ is created by Bjarne Stroustrup of AT&T Bell Labs as an extension of C, C++ is an object-oriented computer language used in the development of enterprise and commercial applications. Microsoft’s Visual C++ became the premier language of choice among developers and programmers.

2. Define inheritance?

The mechanism of deriving a new class (derived) from an old class (base class) is called inheritance. It allows the extension and reuse of existing code without having to rewrite the code from scratch. Inheritance is the process by which objects of one class acquire properties of objects of another class.

3. Define Constructors?

A constructor is a member function with the same name as its class. The constructor is invoked whenever an object of its associated class is created. It is called constructor because it constructs the values of data members of the class.

4. What is the difference between C & C++?

C++ is an object oriented programing but c is a procedure oriented programing. C is super set of C++. C can’t support inheritance, function overloading, method overloading etc. but C++ can do this. In c-program the main function could not return a value but in the C++ the main function should return a value.

5. What do you mean by implicit conversion?
Whenever data types are mixed in an expression then C++ performs the conversion automatically.
Here smaller type is converted to wider type.

Example : in case of integer and float integer is converted into float type.

6. What is the difference between class and structure?
By default, the members of structures are public while that tor class is private.
Structures doesn’t provide something like data hiding which is provided by the classes.
Structures contains only data while class bind both data and member functions.
7. What is dynamic binding?

Dynamic binding (also known as late binding) means that the code associated with a given procedure call is not known until the time of the call at run time. It is associated with polymorphism and inheritance.

8. What is difference between function overloading and operator overloading?
A function is overloaded when same name is given to different function.
While overloading a function, the return type of the functions need to be the same.

9. What is friend function?

The function declaration should be preceded by the keyword friend. The function definitions does not use either the keyword or the scope operator ::. The functions that are declared with the keyword friend as friend function. Thus, a friend function is an ordinary function or a member of another class.

10. What is an iterator?

Iterators are like pointers. They are used to access the elements of containers thus providing a link between algorithms and containers. Iterators are defined for specific containers and used as arguments to algorithms.

11. What are the differences between new and malloc?
New initializes the allocated memory by calling the constructor. Memory allocated with new should be released with delete.
Malloc allocates uninitialized memory.
The allocated memory has to be released with free. New automatically calls the constructor while malloc (doesn’t).

12. What is an explicit constructor?

A conversion constructor declared with the explicit keyword. The compiler does not use an explicit constructor to implement an implied conversion of types. It’s purpose is reserved explicitly for construction. Explicit constructors are simply constructors that cannot take part in an implicit conversion.

13. What do you mean by inline function?

An inline function is a function that is expanded inline when invoked.ie. the compiler replaces the function call with the corresponding function code. An inline function is a function that is expanded in line when it is invoked. That is the compiler replaces the function call with the corresponding function code (similar to macro).

14. What is the difference between a copy constructor and an overloaded assignment operator?

A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class.

15. What is class invariant?

A class invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the correct working of a class. Class invariants must hold when an object is created, and they must be preserved under all operations of the class. In particular all class invariants are both preconditions and post-conditions for all operations or member functions of the class.
Reply With Quote Quick reply to this message
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hindi Important Questions for SSC Unregistered Main Forum 2 10th April 2018 03:08 PM
Important Questions For MBA 1st Sem JNTU payal Online MBA Discussions 2 27th March 2018 01:38 PM
Important MBA Interview Questions kavita Online MBA Discussions 2 23rd March 2018 08:23 AM
MBA HR Related Questions kavita Online MBA Discussions 2 17th March 2018 04:47 PM
OU MBA 4 Sem Important Questions kavita Online MBA Discussions 2 8th March 2018 12:41 PM
Important Questions for RBI Grade B Exam Unregistered Main Forum 1 16th November 2016 11:04 AM
Important Questions For Engineering Physics RGPV Unregistered Main Forum 1 10th October 2016 12:55 PM
Important Questions For JEE Main Unregistered Main Forum 1 28th September 2016 08:47 AM
CA CPT important questions Unregistered Main Forum 0 20th July 2015 09:09 AM
Important Questions for IBPS Clerk Interview Unregistered Main Forum 0 18th July 2015 11:42 AM
Anna University Ge6151 Important Questions Unregistered Main Forum 0 17th July 2015 10:57 AM
Important Questions for UGC NET Commerce Unregistered Main Forum 0 16th July 2015 05:16 PM
OS Important Questions Anna University Unregistered Main Forum 0 14th July 2015 01:51 PM
CDS Exam Important Questions Unregistered Main Forum 0 10th July 2015 08:54 AM
Important Questions related to Java Basic with Answers Unregistered Main Forum 2 8th October 2014 02:14 PM
Important Questions related to C with Answers Unregistered Main Forum 1 8th October 2014 02:04 PM
Andhra Pradesh SSC important questions of all subjects? jagade9 Main Forum 7 31st March 2014 11:33 AM
MBA HR Questions and Answers Neha Majithian Main Forum 2 28th February 2014 04:02 PM
IIM Questions And Answers Karan Arjun Main Forum 1 29th March 2013 05:10 PM
MHT-CET Questions Answers ankitjain_ Main Forum 1 26th September 2012 10:35 AM


Quick Reply
Your Username: Click here to log in

Message:
Options




All times are GMT +5.5. The time now is 12:09 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0 PL2

1 2