GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

C++ Interview Questions


C++ Interview Questions

Questions: 183
Comments: 743
 Showing Questions 1-10 of 183 Questions
[1] 2 3 4 5 6 7 8 9 10 Next >>
 Sponsored Links

 
 C++ Interview Questions
Sorting Options :  

What are the four functions that compiler automatically provides? How can you prevent compiler to provide automatically? 
Latest Answer: default constructorcopy contructor assignment operatordestructor ...

Compare Modular Structered Programming and Object Oriented Programming 
Latest Answer: In Modular programming everything is broken down into modules performing a constituent task. Object Oriented programming revolves around a real world object. A Car Object is different from a driver Object yet both of them communicate using messages (or ...
Read Answers (1) | Asked by : bijula

Which of the following is an illegal cast based on this code snippet? struct B{ operator int();};struct D: B{};B b;float const f = 0;A. static_cast(&b);B. static_cast(b);C. static_cast(b);D. static_cast(&f);E. 
Latest Answer: In order to cast we need something like thisstatic_cast(nValue); ...

What is the problem or error with the following code snippet and how would it be fixed?class Car { public: Car() { num = 1; } private: const int num;};A. You cannot change a const 
Latest Answer: Use initialization list to initialize a const  data member.Car() : num(1) { } should fix the problem. ...

class ABC { public: ABC(int i = 0) { val = i;} int GetVal() {return val;} void SetVal(int i) {val = i;} private: int val;};void DoubleABC(ABC& 
Latest Answer: answer A ...

Which of the following function name is legal in C++?A. $_foo()B. !_foo()C. 1_foo()D. -_foo()E. #_foo() 
Latest Answer: A is the only one that will work.The reason are :!, - are operators, # is the preprocessor operator.      #define, #pragma, also use #9 -> stringify value to char.1 - numeric value (can be used at end of function / method)$ ...

To allow derived class functions to access private base class data, what should you do?A. You should use a private base class function.B. You should use a public or protected base class function.C. You 
Latest Answer: E. but making the base class data protected is a good solution. ...

class ABC { public: ABC(int i = 0) { val = i;} int GetVal() {return val;} void SetVal(int i) {val = i;} private: int val;}void DoubleABC(ABC& 
Latest Answer: Answer is A.There is no problem with the code. ...

Which one of the following statements is FALSE?A. The access privileges in C++ are private, protected and public.B. The default access level assigned to members of a class is private.C. Public members 
Latest Answer: C. Public members of a class can be accessed by everyoneTrue.Look here class CTest {public:   int m_n; };class COther {public:    COther(CTest &obj)   {      obj.m_n = 1; //also okay    ...

Hi I very recently did the C++ online Quiz and was surprised to find that my answer (1) to the following question (below) was incorrect. Is there something I am missing here, or is the answer incorrect. 
Latest Answer: gpuchtel's answer makes sense to me. The fact that size of the derived class object is sum of size of all the public and private members of base class and derived class corroborates the argument. ...

View page [1] 2 3 4 5 6 7 8 9 10 Next >>

Ask A Question
Go Top
 Sponsored Links

 
Ask Question
You must login to Ask Question or Register your free account

Category:

 
Question Title:


Question in Detail:

Add this to my Subscribed Questions (?)
Send me email when new answer is posted (?)

 
Expert Members
Subscribe
Get Latest Updates Via RSS Reader or by Email
 Forum Discussion Subscribe to Forum Discussions Via E-Mail Latest Forum Discussions Subscribers
 Knowledge Base Subscribe to Knowledge Base Series Via E-Mail Knowledge Base Subscribers
 Learning Series Subscribe to GeekInterview Learning Series Via EMail Learning Series Subscribers
 Freelance Jobs Subscribe to GeekInterview Freelance Jobs Via EMail Latest Freelance Jobs Subscribers
 GeekInterview Blog Subscribe to GeekInterview Blog Via EMail GeekInterview Blog Subscribers
 Testing Interview Questions Subscribe to Testing Interview Questions Via EMail Testing Interview Questions Subscribers
 Oracle Interview Questions Subscribe to Oracle Interview Questions Via EMail Oracle Interview Questions Subscribers
 Java Interview Questions Subscribe to Java Interview Questions Via EMail Java Interview Questions Subscribers
 Latest Placement Papers Subscribe to Latest Placement Papers Placement Papers Subscribers
 Free Training Subscribe to Free Training Via EMail Free Training Subscribers
 Learn AJAX Subscribe to AJAXwith.com Via EMail AJAXwith Subscribers
Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape