470,833 Members | 1,405 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

implementation question

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
2 1195

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
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.

Similar topics

2 posts views Thread by Kapil Khosla | last post: by
3 posts views Thread by Yves Dhondt | last post: by
37 posts views Thread by jortizclaver | last post: by
1 post views Thread by Varun Kacholia | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.