Paul Herring <pauljherr...@...> wrote:
> peternilsson42<peternilsso...@...> wrote:
> > Thomas Hruska <thruska@> wrote:
> >> peternilsson42 wrote:
> >> > I've never understood why people don't declare classes...
> >> >
> >> > struct student
> >> > {
> >> > student();
> >> > ~student() { cout << "i am destructor" << endl; }
> >> > void setvalue(const char *);
> >> > void display() const;
> >> >
> >> > private:
> >> > char name[50];
> >> > int stunum;
> >> > };
> >>
> >> Because it looks weird?
> >
> > It seems intuitively obvious to me. :-) You don't put the
> > stuff you want to hide (or restrict access to) first!
>
> I believe his point was that you used struct instead of class,
> not that you put the interesting (to users of your class) stuff
> first.
But that's _why_ I suggested using struct. To me, the
plethora of...
class blah
{
public:
blah()...
...has always seemed indicative of a poor choice of default
access.
--
Peter