samedi 25 avril 2015

my c++ program can't recognize std::string

i'm working on namespaces in c++ and i wrote a short code in cpp. But the program doesn't recognize std::string. I have wrote using namespace std; but it still won't work. what is the problem of my code? please help.

using namespace std;

namespace Student{
    int id;
    string name;
    void printName(){
        cout<<name<<endl;
    }}

int main(){
int myID = Student::id;
Student::printName;

return 0;

}

Aucun commentaire:

Enregistrer un commentaire