FAQ: Functions - Return Types — Beyond the Void

did use “std::cout <, needs_it_support();” inside main to print the returned value.

yes you have to use std::cout << needs_it_support() << “\n”;

I was struggling with this code and revealed the code to see what I was doing wrong, I saw what I did wrong and rather than going to the next section I wanted to get the code into my muscle memory and decided I would write it out, I wrote out the solution exactly and kept getting errors and saying I was wrong. Anyone else experience this, or did I mess up somewhere?

I keep getting
“Make sure to change std::cout << support to return support at the end of the function.”
or
“Inside of main() , make sure to print the result of needs_it_support() to the terminal.”
and I’m so confused.

okay so I figured it out, here’s what I put
bool needs_it_support() {

int support;
std::cout << “Hello. IT. Have you tried turning it off and on again? Enter 1 for yes, 0 for no.\n”;
std::cin >> support;

return support;

}

int main() {

// Change the following line to print the function result:
std::cout << needs_it_support();

}