char test(std::string &h); int main() { std::string e("Test"); cout << test(e); return 0; } char test(std::string &h){ return h[3]; }
Standard input is empty
prog.cpp:1:16: error: ‘string’ is not a member of ‘std’ char test(std::string &h); ^~~~~~ prog.cpp:1:16: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’? +#include <string> char test(std::string &h); ^~~~~~ prog.cpp:1:24: error: ‘h’ was not declared in this scope char test(std::string &h); ^ prog.cpp: In function ‘int main()’: prog.cpp:3:10: error: ‘string’ is not a member of ‘std’ std::string e("Test"); ^~~~~~ prog.cpp:3:10: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’? prog.cpp:4:5: error: ‘cout’ was not declared in this scope cout << test(e); ^~~~ prog.cpp:4:18: error: ‘e’ was not declared in this scope cout << test(e); ^ prog.cpp:4:19: error: ‘test’ cannot be used as a function cout << test(e); ^ prog.cpp: At global scope: prog.cpp:8:16: error: redefinition of ‘char test’ char test(std::string &h){ ^~~~~~ prog.cpp:1:6: note: ‘char test’ previously defined here char test(std::string &h); ^~~~ prog.cpp:8:16: error: ‘string’ is not a member of ‘std’ char test(std::string &h){ ^~~~~~ prog.cpp:8:16: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’? prog.cpp:8:24: error: ‘h’ was not declared in this scope char test(std::string &h){ ^
Standard output is empty