Member function of a class isn't recognized in a function
<p>I'm having a clss student and I used it's member functions in same header of the repository without problem... but now in this function I get an error:</p>

<pre><code>..\StudentRepository.cpp:22:7: error: request for member 'setName' in 'st', which is of non-class type 'Student()'
</code></pre>

<p>And this is the function:</p>

<pre><code>void StudentRepository::loadStudents(){
    ifstream fl;
    fl.open("studs.txt");
    Student st();
    string s,ss;
    int loc;
    if(fl.is_open()){
        while(!(fl.eof())){
            getline(fl,s);
            loc = s.find(",");
            ss = s.substr(0,loc);
            st.setName(ss);

        }
    }
    else{
        cout&lt;&lt;"~~~ File couldn't be open! ~~~"&lt;&lt;endl;
    }
    fl.close();

}
</code></pre>

<p>I have to mention that in the same file I do use them for example this function:</p>

<pre><code> void StudentRepository::editStudent(Student A){
    int i;
    i = findByName(A.getName());
    if( i != 0 || i != NULL){
        students[i].setGroup(A.getGroup());
        students[i].setId(A.getID());
    }
    else{
        throw RepoException("The name does not exist!");
    }
    saveStudents();
}
</code></pre>
