Be the first to post for 'Simplifying With Functions'!

If you’re reading this, there probably aren’t very many posts yet. But don’t worry, you can be the first! Either create a new post or just reply to this one to say ‘hi’.

Working good as far as I can tell.


My Experimental is not like you there is not a few option. without that Program create function easy way like you and it also make prototype of function but there would not being created main.h file in Header files
and can somebody explain how can I change my Eperimental?

I create header file by the manual but it can’t connect cpp file hear is problems:

and here is files:

@DanM are you able to help with this?

You don’t want main.h, keep it like you had it.

yes I can but I want to create a header file and connect it to main file
and how can I do this?

write it std::string instead of string in your main.h. There might be other errors but not quite clear from your Visual Studio screenshots.

yes I know this but main problem is that main.cpp file cannot recognize function’s prototype that are given in main.h file among them void function

I see no errors regarding a void function in your Visual Studio screenshot. All the errors shown there are related to the unrecognized return type string.

You aren’t including <string> in the header.

thank you for helping std::string is working but there is something that can’t understand if order
using std::string in header file it’s wrong order and why?

You forgot the semicolon (otherwise it should work)

using std::string; // don't forget the ;

:slight_smile: so silly mistake :slight_smile: thank you

This is my code for the challenge:

I ended up using void again and it worked fine.

I was wondering how the return Guess works since we need it for our function to work but when we run the code we put in two values and spits out both values when asked for it. What would happen if we used multiple variables?

Have a good day everyone and I am enjoying the course a lot.

I see you’re duplicating code in the userGuesses function. You should delete the duplicate code.
And the function should also have a return type of string and return back the player’s guess.

Privacy & Terms