I was asked a question in my job interview:
"What is the difference between a struct and a class?"
and I simple replied:
"members of struct can be public only while members of a a class can be declared public or private."
but now I am little confused about my answer. I've been looking over the internet over a while for the difference between a strcut and a class but can not see this sort of difference anywhere. Was my answer to the employer incorrect?
If yes, what actually are the difference between struct and class in addition to this one:
members of a class are private by default, whereas members of a struct are public by default.