#include <iostream>#include <string>#include <iomanip>using namespace std; struct Student { string name; int scores[3]; double average; }; int main() { string student s; cout << "enter student name:" << endl; cin >> s.name; return 0;}
Alex
prog.cpp: In function ‘int main()’: prog.cpp:13:17: error: expected initializer before ‘s’ string student s; ^ prog.cpp:15:9: error: ‘s’ was not declared in this scope cin >> s.name; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!