Search found 4 matches
- Thu Jul 30, 2009 11:46 am
- Forum: Programming Discussion
- Topic: [SOLVED] Inheritance / Vector Problem
- Replies: 4
- Views: 393
Re: [SOLVED] Inheritance / Vector Problem
Alright, I realized my problem. Screen::Screen(SDL_Surface* target, int a, int b, int c, int d) { Container(target,a,b,c,d); } Called the Container::Container() parent constructor, which explains why it complained if I removed it. Instead I needed this: Screen::Screen(SDL_Surface* target, int a, int...
- Thu Jul 30, 2009 12:40 am
- Forum: Programming Discussion
- Topic: [SOLVED] Inheritance / Vector Problem
- Replies: 4
- Views: 393
Re: Inheritance / Vector Problem
Here's the two classes then. They're not very large. #ifndef CONTAINER_H_INCLUDED #define CONTAINER_H_INCLUDED #include <vector> #include <iostream> class Container { protected: SDL_Surface* screen; std::vector<Container*> components; public: Container(); Container(SDL_Surface* target, int a, int b,...
- Thu Jul 30, 2009 12:19 am
- Forum: Current Events and Science/Technology
- Topic: The new Axis of evi... I mean Google making a new OS?
- Replies: 45
- Views: 9652
Re: The new Axis of evi... I mean Google making a new OS?
Well, I'm excited to see how it turns out actually...
- Wed Jul 29, 2009 11:36 pm
- Forum: Programming Discussion
- Topic: [SOLVED] Inheritance / Vector Problem
- Replies: 4
- Views: 393
[SOLVED] Inheritance / Vector Problem
Hello, I have a small problem. I made a Container class. A Container class has a vector for other Containers. A Container class also has a draw function. It draws itself, then all of the members of its vector. (Containers are drawn as rectangles so I can experiment.) I can successfully add Container...