答:
#include <iostream>
#include <string.h>
using namespace std;
class CCourse
private:
long no;
char *p_ name;
float credit;
public:
CCourse(long no_ val, char *p_ val, float credit_ val);
~CCourse() { delete p_ name; }
void print() const;
};
class CHLP : public CCourse {
private:char *p_ openby;
public:
CHLP(long no_ val, char *p_val, float credit_ val, char *p_open) : CCourse(no_ val,
p_ val, credit _val)
{
p_ openby = new charstrlen(p_ open)+1];
strcpy(p_ openby, p_ open);
}
~CHLP() { delete p_ openby; }
void studyFor() { cout << "Study for structured programming" << end1; }
};