Problem typoswap
User JJYZZ
Submission Time 2024-06-21 13:10:51
Score 0
Max Time N/A
Max Memory N/A

Compile Error

typoswap.cpp: In constructor ‘String::String(std::string_view)’:
typoswap.cpp:7:35: error: class ‘String’ does not have any field named ‘chars’
7 | String(std::string_view sv) : chars(sv.begin(), sv.end()) {}
| ^~~~~
typoswap.cpp: In member function ‘void String::restructure()’:
typoswap.cpp:11:19: error: ‘chars’ was not declared in this scope; did you mean ‘char’?
11 | auto it = chars.begin();
| ^~~~~
| char
typoswap.cpp: In function ‘std::ostream& operator<<(std::ostream&, const String&)’:
typoswap.cpp:27:25: error: ‘const struct String’ has no member named ‘chars’
27 | for (auto c : s.chars) os << c;
| ^~~~~