Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Function C++
RUS ŠŠ“ŃŠ°Š²ŃŃŠ²ŃŠ¹ŃŠµ, Ń Š¼ŠµŠ½Ń Š²Š¾Š·Š½ŠøŠŗŠ»Š° ŠæŃŠ¾Š±Š»ŠµŠ¼Š°. ŠÆ Ń Š¾ŃŃ ŃŠ“ŠµŠ»Š°ŃŃ ŃŠ°Šŗ, ŃŃŠ¾Š±Ń ŃŃŠ½ŠŗŃŠøŃ Š²Š¾Š·Š²ŃŠ°ŃŠ°Š»Š° Š±ŃŠ»ŠµŠ²Š¾Šµ Š·Š½Š°ŃŠµŠ½ŠøŠµ Šø Š¾Š½Š¾ Š·Š°ŠæŠøŃŃŠ²Š°Š»Š¾ŃŃ Š² ŠæŠµŃŠµŠ¼ŠµŠ½Š½ŃŃ "bol", Š½Š¾ Š²Š¼ŠµŃŃŠ¾ ŃŃŠ¾Š³Š¾ ŠŗŠ¾Š¼ŠæŠøŠ»ŃŃŠ¾Ń Š²ŃŠ“Š°ŃŃ Š¾ŃŠøŠ±ŠŗŃ. ŠŠ· Š·Š° ŃŠµŠ³Š¾ Š²Š¾Š·Š½ŠøŠŗŠ°ŠµŃ ŃŃŠ° Š¾ŃŠøŠ±ŠŗŠ°? ENG Hi. I had a problem. I want the function to return a Boolean value and write it to the variable "bol", but instead the compiler generates an error. What causes this error? https://code.sololearn.com/c6CaBh65F4rl/?ref=app
7 Respostas
+ 2
Your piping to cout is the wrong way:
cout << key
Please! Indent correctly, to make your code readable
+ 1
Change line 12 to the following and it will work:
cout << bol;
0
You have to include
#include <string>
to be able to compare strings.
0
#include <string> is part #include <iostream> , why include it then?
sorry for my bad English
0
There some more features in this header.
0
Okay, I understand the problem. Cout does not output the values of variables of type boolean.
- 1
cout >> bol is wrong, you have to use << with cout