Jun 11, 2011 at 6:52pm UTC
Hello,
How would I go about inheriting a function and changing it?
Here is what I have so far..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
...Code here...
class Item {
protected :
...a bunch of variables...
public :
...a bunch of functions here...
//Magic
void Draw ();
};
void Item::Draw () {
...operations...
}
class File: public Item {
public :
void Draw ();
};
void File::Draw () {
Item::Draw();
...operations to add to Item::Draw...
}
Item *items[32000];
items[0] = new File();
...More code here...
items[0]->Draw();
...Rest of program...
What I get from the above code, is that the Item::Draw function works.. but it doesn't add the File stuff..
Thanks!
P.S.
If you want all of the code I can send a link. (too much to post here :S)
Last edited on Jun 11, 2011 at 7:02pm UTC
Jun 11, 2011 at 8:20pm UTC
@L B
thanks
@ CreativeMFS
no, because there are more classes than just "File" that I also want to group in that array