Help with Function Practice question

I’m still new to this and was doing the practice function questions, when I came across this question. Even though I can get it to run, and get the proper output it was asking for. When I hit check the answer, it won’t let me proceed. Telling me to “has a return value — change its return type.”. I’m not sure what it means by that, because if I change my code I won’t be able to run it anymore. What am I missing?

#include <iostream> void mango_juice() { std::cout << "Voila! Mango juice!"; } int main() { mango_juice(); return 0; }

HELLO!
Try removing line 12 ( return 0 ).
It might seem counterintuitive, but it’s not always necessary to return from main.

I don’t remember the exercise,
but functions can have other return types besides void.
For example, if you want the function to output something, and you want that output to be a string,
you’d do
std::string mango_juice() {
and then the appropriate return inside that mango_juice function.

Here’s an example:

#include <iostream> std::string mango_juice() { std::string message = "Voila! Mango juice!"; return message; } int main() { std::string juice = mango_juice(); std::cout << juice; return 0; }

Thank you for taking the time to reply, but that wasn’t it either.

Thank you, that seems to be what I was doing wrong.