Can there be two public section in a class? If yes then why ? And in which circumstances we do so?

Posted by Abhi on Stack Overflow See other posts from Stack Overflow or by Abhi
Published on 2010-04-27T08:11:07Z Indexed on 2010/04/27 8:13 UTC
Read the original article Hit count: 257

Filed under:
|
|

Dear all

I have a doubt related to class. For example

class A
{
public:
A()
{
.....
.....
}

void cleanup()
{
....
....
....
}

public:
UINT a;
ULONG b;
};

In the above example there are two public section, In first section i am defining constructor and the method and in the second section i am declaring data members. Does the above class i.e. A is correct. Can we do so? If yes then why we needed and in which circumstances we should use it? Also we can do the entire thing in one section then why un necessary we r taking two section...?

Thanks and regards

Abhineet Agarwal

© Stack Overflow or respective owner

Related posts about c++

Related posts about class