Decralation of class inside other class and definition outside this class

  • Thread starter =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki
  • Start date
?

=?ISO-8859-2?Q?Miros=B3aw?= Makowiecki

We have here class of C++ language:
namespace Apt
{
class Name1
{
public:
class Name2;
};
}
I 'm give ebove class Name2 so a declalation of class without a definition
because to it do not shaded class Name1.
Question:How have it define class Name2 outside of class Name1,and to have a
decralation od class Name2 inside a class Name1?
Thanks in Advance.
 
R

Robert Bauck Hamar

Mirosław Makowiecki said:
We have here class of C++ language:
namespace Apt
{
class Name1
{
public:
class Name2;
};
}
I 'm give ebove class Name2 so a declalation of class without a
definition
because to it do not shaded class Name1.
Question:How have it define class Name2 outside of class Name1,and to have
a decralation od class Name2 inside a class Name1?
Thanks in Advance.

namespace Apt
{
class Name1 { public: class Name2; /*...*/ };
class Name1::Name2 { /*...*/ };
}
 
A

Alf P. Steinbach

* Mirosław Makowiecki:
We have here class of C++ language:
namespace Apt
{
class Name1
{
public:
class Name2;
};
}
I 'm give ebove class Name2 so a declalation of class without a definition
because to it do not shaded class Name1.
Question:How have it define class Name2 outside of class Name1


class Name1::Name2
{
...
};

,and to have a decralation od class Name2 inside a class Name1?

?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top