title: So now struct can have virtual function and support inheritance ? What difference with classes then ? What the true purpose of information hiding?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <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>  </p>
  </blockquote>
  
  
  
  <p><a href="http://www.cplusplus.com/reference/std/typeinfo/type_info/" rel="nofollow noreferrer">http://www.cplusplus.com/reference/std/typeinfo/type_info/</a></p>
  
  <p>I guess my "teacher" didn't tell me a lot about the differences between struct and classes in C++.</p>
  
  <p>I read in some other question that concerning inheritance, struct are public by default... I also guess struct doesn't have constructors/destructors...</p>
  
  <p>What are the other differences then ? Do they matter that much ?</p>
  
  <p>And when speaking about private/protected attributes/methods, they aren't accessible at runtime, only because the compiler tells it so at compile time and reports an error, right ? Then comparing those features with classes, what does "information hiding" really bring to the programmer ? Is it here so that when somebody reuse the class, this person won't misuse the class because the private/protected stuff will be reported by the compiler ?</p>
  
  <p>I still struggle with the real purpose of information hiding, it still want to sound in my head like it brings more security in programs, meaning less security breaches, but I'm really confused about the goal of such design in the language... (And I Don't intend to be against C++ in any way, I just to understand in what cases this feature can be interesting or not; if not, that's not a problem, but I just like to know...).</p>