I have been told that the only difference between a class and a struct is
the default interface - private for class, public for struct. My instructor
made this statement:

Actually there are only 2 differences between classes and structs:
1) The default interface for a class is private whereas it is publie for a
struct.
2) A struct supports array-type initialization syntax in addition to
constructors whereas a class requires constructors only.

I have been told that the only difference between a class and a struct is the default interface - private for class, public for struct. My instructor made this statement:

Actually there are only 2 differences between classes and structs: 1) The default interface for a class is private whereas it is publie for a struct. 2) A struct supports array-type initialization syntax in addition to constructors whereas a class requires constructors only.

I have been told that the only difference between a class and a struct is the default interface - private for class, public for struct. My instructor made this statement:

Actually there are only 2 differences between classes and structs: 1) The default interface for a class is private whereas it is publie for a struct. 2) A struct supports array-type initialization syntax in addition to constructors whereas a class requires constructors only.
2) is wrong. The correct statement is that array-type initialization syntax
is only possible when all data members are public. This is the case by
default with a struct, but not with a class.

No. Another difference is that the keyword 'class' can be used in a template type argument declaration as an alternative to 'typename' and 'struct' cannot.

Isn't all this described in the FAQ? Why do we keep talking about it when it's all has be discussed countless number of times? Don't you have access to 'groups.google.com'?

On top of that, inheritance for a struct is implicitly public, while it's private (or protected?) for a class.

It's private for a class, but you can sort of derive this from the member
access rule: base class members are inherited (become _members_) for the
purpose of name lookup, for example. And the class _name_ is its member,
however strange this might sound.

I have been told that the only difference between a class and a struct is the default interface - private for class, public for struct. My instructor made this statement:

Actually there are only 2 differences between classes and structs: 1) The default interface for a class is private whereas it is publie for a struct.
Yes.
2) A struct supports array-type initialization syntax in addition to constructors whereas a class requires constructors only.
No.

|| And the class _name_ is its member, however strange this might
sound.
Just so I understand this (must have perused that line three times).
Put another way: For name lookup purpose, the 'base' class _name_ is
the name in the derived? Perhaps I'm missing something with the line
'is its member'.

|| And the class _name_ is its member, however strange this might sound. Just so I understand this (must have perused that line three times). Put another way: For name lookup purpose, the 'base' class _name_ is the name in the derived? Perhaps I'm missing something with the line 'is its member'.

class A {};

inside the class 'A's scope, "A" is a _member_. When you derive from
a class, all its members are inherited (unless they are hidden). So,
when you write

I have been told that the only difference between a class and a struct is the default interface - private for class, public for struct. My instructor made this statement:

Actually there are only 2 differences between classes and structs: 1) The default interface for a class is private whereas it is publie for a struct. 2) A struct supports array-type initialization syntax in addition to constructors whereas a class requires constructors only.