GeekInterview.com
  I am new, Sign me up!
 

C++ Interview Questions


C++ Interview Questions

Questions: 203
Comments: 914
 Showing Questions 21-30 of 203 Questions
<< Previous 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: 1) Default constructor 2) Copy constructor 3) Assignment operator 4) Destructor We can stop the compiler by providing the definition for all the four functions. ...

Compare Modular Structered Programming and Object Oriented Programming 
Latest Answer: Modular programming promotes the separation of a program into components called modules. Interfaces act as the logical boundaries between modules which express elements that are provided and required by the module. All elements defined within ...
Read Answers (2) | 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: They are all syntax error. The syntax isstatic_cast(expression)What is the target type of these casts? ...

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: Using initialiser list is one way,and making the data num mutable is another ...

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: There is no problem ...

Which of the following function name is legal in C++?A. $_foo()B. !_foo()C. 1_foo()D. -_foo()E. #_foo() 
Latest Answer: void $_foo();Can be used as function name ...

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: F. None of the above are entirely the right answerYou can provide a method in the base class to allow the private data to be read or written and then provide an access specifier in the derived class which allows the methods to be called.  For example:class ...

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: The class has a missing semi-colon ';' following the closing brace. So the answer should be: E: None of the above ...

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: Protected members are accessible by its sub-classes.Protected members are not acceble by its sub classes, as when they inherit base class protected variables of base class becomes private to sub class. So it can't access. ...

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: You can if the base class provides public or protected methods that modify its private data.  Then derived class can expose this using access specifiers. ...

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

Ask A Question
Go Top
 Sponsored Links

 
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
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape