title: Why public ref in c++ class definition
body: <p>First of all I want to make clear that 'm all new to C++, so this might be a simple and somewhat obvious question. In the C++ book I'm reading called C++ Primer, a class is defined by writing:</p>
  
  <pre><code>class classname{
  public:
  
  private:
  
  };
  </code></pre>
  
  <p>However, in VS2008 the compiler didnt like this. But by adding public ref before class, as in:</p>
  
  <pre><code>public ref class classname{
  </code></pre>
  
  <p>it went through in the compiler. Can anyone please explain what the difference is between defining only with class and with public ref class? I would really appreciate it.</p>