GeekInterview.com
  I am new, Sign me up!
 

C++ Interview Questions


C++ Interview Questions

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

 
 C++ Interview Questions
Sorting Options :  

To invoke the virtual toString() function defined in GeometricObject from a Circle object c, use :A. ((GeometricObject*)c)->toString();B. c.super.toString()C. (GeometricObject*)c->toString();D. c->GeometricObject::toString() 
Latest Answer: When using polymorphic functions(virtual), in order to access the BASE class version of the function from WITHIN the Derived class, one would simply say "Base::functionName()".For e.g:class CGeometricObject{public:virtual void toString(){// ...
Read Answers (2) | Asked by : dlee6565

How can a C++ developer use the placement new syntax to make new allocate an object of class SomeClass at a particular memory address stored in a pointer type variable named pmem?A. new SomeClass(pmem);B. 
Latest Answer: It is B , provided pmem is an allocated pointer (meaning memory already allocated to it). See this link for more explanation: http://www.geekinterview.com/question_details/16559 ...
Read Answers (2) | Asked by : dlee6565

Which of the following statements accurately describe unary postfix operator++ overloading in C++?A. It can be overloaded with no parameters when the operator function is a class member.B. It can only 
Latest Answer: In the previous,Increment(*this); // whatever you want it to mean... was meant to be pseudocode. Taken literally, it will pass this object by value and therefore do nothing to it.I should have written simply Increment(); ...
Read Answers (2) | Asked by : dlee6565

Which one of the following statements regarding C++ class inheritance is FALSE? a. Inheritance promotes generic design and code reuse.b. Struct cannot be inherited in C++. c. C++ supports multiple 
Latest Answer: The only difference between a class and a struct is a class has private access and private inheritance by default and a struct has public access and public inheritance by default. The only place I'm aware of that you can't replace class with struct is ...

Which one of the statements concerning data encapsulation is FALSE? A. Data encapsulation lets the programmer create an object and then provide an interface that other objects can use to invoke the methods 
Latest Answer: E is wrong. Everything else looks right. ...

Why p++ is faster than p+1? 
Latest Answer: I think P++ and ++P are the sameNo, not the same.For P++ you have to save value in a temp, increment *this, then return the saved value.For ++P, you just increment and return -- less work. ...

When we allocates the memory using malloc() and calloc(), it returns pointer pointing to the base address to the allocated memory. But while freeing the memory we call free(pointer) thenHow the operation 
Latest Answer: Dynamic memory is allocated on heap. De-allocation is counterpart of the allocation operation. the task of allocation and De-allocation is handled by the base/standard libraries. These store information about the allocated memory like base address ...

What are the advantages of inline functions over macros? 
Latest Answer: Inline function very much confused to use it or not.Well I want to just tell you that it has large number of disadvantages than advantages Inline function works faster than normal function. They are included in the code where the function call appears. ...
Read Answers (6) | Asked by : chilton

What is default parameter? Can a overloaded function have a default parameter? 
Latest Answer: This is my answer, please correct me if I am wrong.Overloading functions with default parameters will cause compile error for ambiguous calling on the overloaded function.  But it really depends on the signatures of the overloaded function. If you ...

Write a program that will read in a length in feet and inches and will output the equivalent length in meters and centimeter. Use at least three functions: one for input, one or more for calculating, and 
Latest Answer: #include "iostream"using namespace std;struct metric{ int meters; int centimeters;};struct english{ int feet; int inches;};void input( english &value ) { std::cout

View page [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