0
No match for operator <<
What's wrong with using << for cout? :( https://sololearn.com/compiler-playground/c67WJOIWXf54/?ref=app
7 ответов
+ 3
StarCodes
as Jerry Hobby explained, your problem is using unescaped '\' in lines 7 and 9.
cout << "/ \" << endl;
should be
cout<<"/ \\"<<endl;
cout << "\___/" << endl;
should be
cout<<"\\___/"<<endl;
+ 5
you can also use raw string literal
cout << R"x( your string )x""\n";
then you won't need to bother with escape characters and newlines
https://sololearn.com/compiler-playground/c1r2S83weC09/?ref=app
+ 4
The problem is with the text. You have a backslash. That needs to be escaped because it’s special. Check this
#include <iostream>
using namespace std;
int main() {
//circle
cout << " ___" << endl;
cout << "/ \\" << endl;
cout << "| |" << endl;
cout << "\\___/" << endl;
}
+ 2
Show us the code. The << operator should work, but we can't see what's wrong until we see your code.
+ 2
StarCodes are you using the single character « instead of <<? It resembles the << left shift operator. However, it is not used as an operator in programming languages but can visually resemble the << symbol.
+ 2
You can use char() instead of escape characters StarCodes
0
Brian No, I usually make projects on mobile.