Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In fact, in C++ structs and classes are the same thing, only struct declarations starts with public visibility by default and class declarations starts with private visibility by default.

That's their only difference in C++.

And so instances of structs and instances of classes are the same thing in C++ too.

You will even sometimes see member functions defined on structs.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: