Code:
#include <iostream>
#include <string>
using namespace std;
struct student
{
string name;
int grade;
}
int main()
{
student people1;
student people2;
cout << "Please enter student name: ";
cin >> people1.name;
cout <<" Pleae enter student grade: ";
cin >> people1.grade;
cout << "Please enter student name: ";
cin >> people2.name;
cout <<" Pleae enter student grade: ";
cin >> people2.grade;
system ("pause");
}
C:\Users\gameffect\Documents\c++ examples\stringsex.cpp\structex.cpp|6|error: new types may not be defined in a return type|
C:\Users\gameffect\Documents\c++ examples\stringsex.cpp\structex.cpp|6|note: (perhaps a semicolon is missing after the definition of 'student')|
C:\Users\gameffect\Documents\c++ examples\stringsex.cpp\structex.cpp|14|error: two or more data types in declaration of 'main'|
||=== Build finished: 2 errors, 0 warnings ===|