fork download
  1. #ifndef STRUCT02_H_
  2. #define STRUCT02_H_
  3.  
  4. #include <iostream>
  5. #include <string>
  6. #include <typeinfo>
  7. #include <cassert>
  8.  
  9. inline void readStruct(){
  10. student test;
  11. std::cin >> test.name >> test.number >> test.group >> test.score_concept;
  12. for (int i = 0; i < 4; ++i)
  13. std::cin >> test.score_implement[i];
  14. std::cout << test;
  15. }
  16.  
  17. int main() {
  18. std::ios_base::sync_with_stdio(0); std::cin.tie(0);
  19. int N;
  20. std::cin >> N;
  21. while(N--){
  22. readStruct();
  23. }
  24. }
  25. #endif // STRUCT02_H_
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void readStruct()’:
prog.cpp:10:5: error: ‘student’ was not declared in this scope
     student test;
     ^~~~~~~
prog.cpp:10:5: note: suggested alternative: ‘stderr’
     student test;
     ^~~~~~~
     stderr
prog.cpp:11:17: error: ‘test’ was not declared in this scope
     std::cin >> test.name >> test.number >> test.group >> test.score_concept;
                 ^~~~
prog.cpp:11:17: note: suggested alternative: ‘tzset’
     std::cin >> test.name >> test.number >> test.group >> test.score_concept;
                 ^~~~
                 tzset
stdout
Standard output is empty