|
-
April 16th, 2010, 07:27 AM
#12
Re: I want to optimize my code
 Originally Posted by Paul McKenzie
The destructor for the base class should be virtual.
Code:
#pragma once
#include"RandomNumber.h"
class Body
{
private:
RandomNumber Random;
protected:
int x;
int y;
int move;
int moved;
public:
Body(void);
virtual ~Body(void);
Regards,
Paul McKenzie
so my .cpp will not change?
Code:
Body::~Body(void)
{
}
i will delete all the dynamic pointers in main
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|