I\'m getting an unhandled exception reading location 0x00000008 (reading NULL value) on the noted line below, relevant methods leading up to the error are included (continued below examples):
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
Consider the following classes: class Coord { public: double _x, _y; Coord(double x, double y) { _x = x; _y = y;
I think I understand the concept开发者_如何学Python of virtual methods and vtables, but I don\'t understand why there is a difference between passing the object as a pointer(or reference) and passing
class Base { int iBase; public: virtual void display() { cout<<\"I am a Base Class\"<<endl; }开发者_高级运维
I want to ask what happen, when I use virtual functions without pointers ? for example: #include <iostream>
g++ -std=gnu++0x main.cpp In file included from main.cpp:6:0: CustArray.h: In constructor \'CustArray::CustArray()\':
The following code, prints out Derived Base Base But I need every Derived object put into User::items, call its own print function, but not the base class one. Can I achieve that without using poin
I am designing an exception hierarchy in C++ for my library. The \"hierarchy\" is 4 classes derived from std::runtime_error. I would like to avoid the slicing problem for the exception classes so made
If I understand slicing correctly I don\'t think this could happen with pointers or smart pointers. For example, if you had: