title: Generic Classes in C++
body: <p>I was reading the topic Generic Classes .I got stuck at one point .Following is the piece of code</p>
  
  <pre><code>template &lt;class StackType&gt; class stack
  {
      StackType stck[10];
      int tos;
  public:
      stack() {tos=0;}
      void push(StackType ob);
      StackType pop();
  };
  </code></pre>
  
  <p>My question is that in <code>template &lt;class StackType&gt; class stack</code>,
  there are two classes made (<code>StackType</code> and <code>stack</code>)?</p>
  
  <p>I mean how does the compiler treat this as like making stack a nested class of StackType or something else?</p>