Your understanding of functions is a little bit wrong.
First, you must allways declare how many arguments take your function.
As example this:
Code:
void Instructions( );
Empty parenthesis stay for no or more arguments. This is undefined behavior!
Should the function take realy no arguments, than write it, like:
Code:
void Instructions(void);
Second, if you need the returned value from a function, than you must take it.
This is, like you go to a condom automat, insert coins and go away without to take the condom.
Have a nice night with your girl/boy-friend and few weeks letter, your girl/boy-friend are in undefinded behavior (and you too).
So, this is better:
Code:
char userLetter;
userLetter = GetUserLetter();
Same here:
Code:
winOrLose = CheckLetter(userLetter, letter);
Other points are:
Please read your function 'CheckLetter' very carefully.
They dont do what you expect.
I suggest you to rewrite this funktion with the returned values:
-1 = letter comes after (your letter is to low)
0 = it is the letter
1 = letter comes before(your letter is to high)
This goes conformable with the functioncall above.
Please check if the file was realy opened.
You open the file correctly …
Code:
inp=fopen("game.txt", "r");
… but you dont check, if its realy open.
Check it with:
Code:
if (inp == NULL) { /* give out error message and quit */ }
I dont know, why you edit this call:
Code:
//Play one game (Call PlayOneRound function)
SingleGame(i);
At the begining it was:
Code:
//Play one game (Call PlayOneRound function)
int = SingleGame(char letter);
Here you have give the funktion the argument 'letter', that was right (without type).
Only the returned value should be assigned to the right variable.
I think it should by:
Code:
//Play one game (Call PlayOneRound function)
uWINuLOSE = SingleGame(letter);
So, now I hope you have a little idea how functions work and how came the returned value back to the caller.
Go through all your functions and read carefully what it those and read also all callings to it.
Look what you give as arguments and what give it back.
PS: sorry for my horrible engish, thats not my native language