/in/foo.cc:4:2: error: 'string' does not name a type
string name;
^~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:12:3: error: 'cin' was not declared in this scope
cin >> student[i].name;
^~~
/in/foo.cc:12:3: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:60:18: note: 'std::cin'
extern istream cin; /// Linked to standard input
^~~
/in/foo.cc:12:21: error: 'struct student' has no member named 'name'
cin >> student[i].name;
^~~~
/in/foo.cc:22:36: error: 'struct student' has no member named 'name'
printf("%s\n%d\n%d", student[mid].name, student[mid].total, score);
^~~~