By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,529 Members | 864 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,529 IT Pros & Developers. It's quick & easy.

implementation question

P: n/a
I had the following question on a C++ test and I don't think I got it
right and I was hoping someone could answer it. I am pretty new to C++.
Thanks.
The question was, given the following code :

class A {

private:
int a_;
static double db_;
public :
A();
};
class B: public A {
private:
int b_;
public:
B();
B(const B& src);
};
class C {
{
private:
B* pb_;
public:
C();
C(const C& );
const C& operator=(const C& src);
~C() {delete pb_; }
};
implement the classes A, B and C. I'm not even sure I understand the
question but I think they mean, write the specific code for the
constructors and write the code ( in main ) that would create specific
instances of A, B and C. Thank you very much to whoever would be kind
enough to do this.

Mark

Apr 10 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

markpark wrote:
I had the following question on a C++ test and I don't think I got it
right and I was hoping someone could answer it. I am pretty new to C++.
Thanks.
And what on Earth made you think comp.lang.c, rather than comp.lang.c++
was the right place to ask.

Followups set...


The question was, given the following code :

class A {

private:
int a_;
static double db_;
public :
A();
};
class B: public A {
private:
int b_;
public:
B();
B(const B& src);
};
class C {
{
private:
B* pb_;
public:
C();
C(const C& );
const C& operator=(const C& src);
~C() {delete pb_; }
};
implement the classes A, B and C. I'm not even sure I understand the
question but I think they mean, write the specific code for the
constructors and write the code ( in main ) that would create specific
instances of A, B and C. Thank you very much to whoever would be kind
enough to do this.

Mark


Apr 10 '06 #2

P: n/a
markpark wrote:
I had the following question on a C++ test and I don't think I got it
right and I was hoping someone could answer it. I am pretty new to C++.


[snip]

Wrong group. This is comp.lang.c, we discuss C here, not that other
completely different language you are asking about, try comp.lang.c++.

Robert Gamble

Apr 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.