title: What is the history of struct/class in C++?
body: <p>I'm taking a class on Object Oriented Programming in C++. In a recent assignment I defined a member function within a <code>struct</code>. My instructor explained that, although it's compilable to use member functions within structs, he would prefer we didn't, for backward compatibility with C, and (especially in this beginner class) to practice good data encapsulation- we should use a <code>struct</code> for types that contain mostly data, and a <code>class</code> for applications that benefit from more procedural encapsulation. He indicated that this practice comes from the history of structs/classes in C++, which is what I'd like to know more about.</p>
  
  <p>I know that structs are functionally the same as classes except for default member/inheritance access. My question is:</p>
  
  <p>Why are structs AND classes included in C++? From my background in C#, where structs and classes have important differences, it seems like <code>struct</code> in C++ is just syntactic sugar for defining classes with default public-ness. Is it?</p>
  
  <p>I'm <strong>not looking for opinions</strong> on when/why one should be used instead of the other- I was born well after these constructs were, and I'm looking for the <strong>history</strong> of them. Were they conceived together? If so, why? If not, which came first, and why was the second added? I realize that there are many venerable elders within this community who may have living memory of these features' origins, and links to standards publications, or examples of code, where both, one, or the other first appeared, will add to answers' helpfulness.</p>
  
  <p>Please note, this question is <strong><em>not</em></strong>:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/92859/what-are-the-differences-between-struct-and-class-in-c">What are the differences between struct and class in C++?</a></li>
  <li><a href="https://stackoverflow.com/questions/15572665/c-structs-with-member-functions-vs-classes-with-public-variables/15573150">C++ Structs with Member Functions vs. Classes with Public Variables</a></li>
  <li><a href="https://stackoverflow.com/questions/24196885/can-c-struct-have-member-functions">Can C++ struct have member functions?</a></li>
  <li>nor <a href="https://stackoverflow.com/questions/13125944/function-for-c-struct">Function for C++ struct</a></li>
  </ul>