Glad to see that my solution in the other thread worked for you. You might want to post that it worked in that thread, so people who find your thread through google know the solution worked. This forum exists for the benefit of everyone.
You're very close actually. You're not declaring the variables wrong, just using them in the wrong way.
If you want to use variables from a base class, even if you have access to them, you must still explicitly say they're in the base class. Like
When I do this for all the Sum variables you access in GrandSum, your code works fine.
Hi,
I have a base class and derived a class from the base class, i want to print & read the data for the object created for the derived class,so i have overloaded both the << and >> operators and also have done the foward declaration.
Below is the code snippet,
#include <iostream>
class... (3 Replies)
im just trying to have some fun and kill some time writing a c++ program that has a person type in a car make and model then gives them a year and a price. or something like that. i always have problems getting it goin but once the ball is rolling im usually pretty good. anyone wanna help me out? ... (1 Reply)
Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento)
typedef struct elemento
{
char name;
char value;
List<struct elemento> ltElementos;
... (7 Replies)
Hi everybody
I am facing a little problem with names servers. I have a VPS with Kloxo installed on it
I have registered 2 name servers (i.e. ns1.domain.com and ns2.domain.com) past one month.
These nameservers are not accessible yet. I have check the nameserver on internic site and they are... (3 Replies)
Hello,
What is the simplest way to install CentOS 6.1 with console base-system only using official LiveDVD image on VirtualBox machine? I'd like to get simplest console with network support like FreeBSD base installation. Then, install services which I need.
The installer jest extracts the... (2 Replies)
Hi,
I believe the next code is wrong:
class Egg {
Egg e;
int i;
Egg(int ii=0) : i(ii) {}
};
because you would end up with an endless definition (memory allocation) of Egg objects, thus int i.
Ok, so God Eckel proposes for a singleton:
class Egg {
static Egg e;
int... (5 Replies)
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
I have the two class definition as follows.
class A { public: int a; };
class B : virtual public A{ };
The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Hello All,
I am a learner in C++. I was testing my inheritance knowledge with following piece of code.
#include <iostream>
using namespace std;
class base
{
public :
void display()
{
cout << "In base display()" << endl;
}
void display(int k)
{... (2 Replies)