Trying to make a stack of strings. Getting missing type specifier error
<p>So I've tried adding an int to where the error is coming from, but that just adds a ton of new errors. I've googled around for a bit, but I haven't found anything that helps me, or maybe I just don't understand a lot of whats being said. </p>

<pre><code>#include &lt;iostream&gt;

#include &lt;string&gt;
using namespace std;

//Define the stack class, set default stack size to 7
//use a template to define type at later point

template&lt;class T,int size=7&gt;
class stack
{
private: T data[size];
int stack_ptr;
public:
stack(void);
void push(T x);
T pop();
T top();
};

//constructor function to initialize stack and data
template&lt;class T, int size&gt;
stack&lt;T, size&gt;::stack(void)
{
int i;
for(i=0;i&lt;size;i++) data[i]=0;
stack_ptr=0;
}

//Push data onto stack
template&lt;class T,int size&gt;
void stack&lt;T, size&gt;::push(T x)
{
if(stack_ptr&gt;=size)
  {

    cout&lt;&lt;"cannot push data: stack full"&lt;&lt;endl;
    return;
  }
data[stack_ptr++]=x;
cout&lt;&lt;"Pushed\t" &lt;&lt; x &lt;&lt; "\tonto the stack"&lt;&lt;endl;
return;
}

//Pop data from stack
template&lt;class T, int size&gt;
stack&lt;T, size&gt;::pop()
{
using namespace std;
if(stack_ptr&lt;=0)
  {

    cout&lt;&lt;"cannot pop data: stack empty"&lt;&lt;endl;
    return data[0];
  }
cout&lt;&lt;"popped\t"&lt;&lt; data[--stack_ptr]&lt;&lt; "\tfrom stack"&lt;&lt;endl;
return data[stack_ptr];
}


int main()
{

//declaring stack of strings and using default size
stack&lt;string&gt; c;
string w;
string name1 = "Rich";
string name2 = "Debbie";
string name3 = "Robin";
string name4 = "Dustin";
string name5 = "Philip";
string name6 = "Jane";
string name7 = "Joseph";
c.push(name1);
c.push(name2);
c.push(name3);
c.push(name4);
c.push(name5);
c.push(name6);
c.push(name7);

//pick up the stack value
w=c.pop();
string &amp; i = c.top( );
string next_top = c.top();

cout &lt;&lt; "The top person the stack is " &lt;&lt; next_top &lt;&lt; "."&lt;&lt; endl;

return 0;
}
</code></pre>

<p>And here is my error</p>

<pre><code>1&gt;------ Build started: Project: A-2, Configuration: Debug Win32 ------
1&gt;  A-2.cpp
1&gt;h:\pf3\a-2\a-2\a-2.cpp(55): error C4430: missing type specifier-int assumed.         
Note:    C++ does not support default-int
</code></pre>

<p>I'm not sure what else I can do, any help is appreciated.</p>
