build/Debug/Cygwin_4.x-Windows/main.o:main.cpp:(.rdata$.refptr.gameIsNotOver[.refptr.gameIsNotOver]+0x0): undefined reference to `gameIsNotOver'
build/Debug/Cygwin_4.x-Windows/main.o:main.cpp:(.rdata$.refptr.input[.refptr.input]+0x0): undefined reference to `input'
In main.h, you have declared input and gameIsNotOver as extern, but you haven't actually defined them anywhere.
I think your problem is actually coming from not understanding functions. One things I see is on line 197 and 202, where you try to do something after having returned from the function. After you've returned, the function is finished; you cannot continue to do things after that point.
Additionally, checkForWinner() seems to be returning whether or not the game has ended yet, though on lines 231 and 234 you don't store the information or even try to use it.
That is pretty true, i've been struggling with functions in this program alot and finding out I know alot less about them then I thought.
And thanks I totally missed that I didn't define either input or gameIsNotOver.
I'll define those variables and would putting the call to playerWins() or playerLoses() before the return fix that problem?
I'll take a look at how checkForWinner is working and I was planning on adding some conditionals and storing that somehow but I guess I just kinda blew right by that.
btw thanks a ton for such a nice reply.
I'll define those variables and would putting the call to playerWins() or playerLoses() before the return fix that problem?
You would run those functions, and then execution would continue to the return statement and return the value, yes. If you don't know how to use a debugger, now would be a great time to learn as it will help you figure out how your code works.