Declare a pointer to different class in member funcion
<pre><code>#include&lt;iostream&gt;
using namespace std;

class StudentClass{
friend class Oopclass;
public:
    StudentClass();
    void setStudentData();
    void printStudentScore();
    StudentClass* next;
    ~StudentClass();
private:
    string std_ID;
    int sID, sMid, sFin, sOP, hw[3];   
    double sTotal; 

};

class OopClass{
friend class StudentClass;
public:
    OopClass();
    void setOopData();
    void printOopScore();
    void queryOopScore();
    void findOopAverageScore();
    void addStudentData();
    void deleteStudentData();
    void updateStudentData();
    ~OopClass();
private:
    string professor, subject;
    int cSn;
    double cSAvg;
    StudentClass* cSAddr;
};

int main(int argc, char **argv){
OopClass Info[3];
Info[0].setOopData();
return 0;
}

StudentClass::StudentClass(){
}
void StudentClass(){
}
void StudentClass::setStudentData() {

}
StudentClass::~StudentClass(){
}
OopClass::OopClass(){
}
void OopClass::setOopData() {
cout &lt;&lt; "Professor?" &lt;&lt; endl;
cin &gt;&gt; professor;
cout &lt;&lt; "Subject?" &lt;&lt; endl;
cin &gt;&gt; subject; 
cout &lt;&lt; "How many students do you want to input ?" &lt;&lt; endl;
int number = 0;
cin &gt;&gt; number;
cSAddr = new StudentClass;
//for(int i = 0; i &lt; number; i ++) setStudentData();

}
OopClass::~OopClass(){
}
</code></pre>

<p>When I tired to write "cSAddr = new StudentClass;" ,it come up to</p>

<p>error about </p>

<blockquote>
  <p>"  C:\Users\lypan\Documents\final.cpp In member function 'void
  OopClass::setOopData()': </p>
  
  <p>63 14 C:\Users\lypan\Documents\final.cpp [Error] expected
  type-specifier before 'StudentClass' </p>
  
  <p>63 14 C:\Users\lypan\Documents\final.cpp [Error] invalid conversion
  from 'int*' to 'int' [-fpermissive] </p>
  
  <p>63 14 C:\Users\lypan\Documents\final.cpp [Error] expected ',' or ';'
  before 'StudentClass'  "</p>
</blockquote>

<p>And I have no idea why I do wrong, please tell me what I make mistake. Thx!</p>
