Function C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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

17th Apr 2018, 5:09 AM
Black & White
Black & White - avatar
7 Answers
+ 2
Your piping to cout is the wrong way: cout << key Please! Indent correctly, to make your code readable
17th Apr 2018, 6:50 AM
Loeschzwerg
+ 1
Change line 12 to the following and it will work: cout << bol;
17th Apr 2018, 8:59 AM
Ipang
0
You have to include #include <string> to be able to compare strings.
17th Apr 2018, 5:16 AM
XiLef
0
#include <string> is part #include <iostream> , why include it then? sorry for my bad English
17th Apr 2018, 5:20 AM
Black & White
Black & White - avatar
0
There some more features in this header.
17th Apr 2018, 5:21 AM
XiLef
0
Okay, I understand the problem. Cout does not output the values of variables of type boolean.
17th Apr 2018, 5:27 AM
Black & White
Black & White - avatar
- 1
cout >> bol is wrong, you have to use << with cout
17th Apr 2018, 9:30 PM
$ยข๐Žโ‚น๐”ญ!๐จ๐“
$ยข๐Žโ‚น๐”ญ!๐จ๐“ - avatar