Hi Justin,
Some small things that may help you:
When using any of the scanf functions,
always make use of it's return value to check how successful the function call was.
Also, one has to get the format string exactly right - with correct spaces etc, otherwise there will be errors.
Unfortunately the example in this link doesn't show any checking.
When opening files,
always make sure that it worked by checking the file pointer returned is not equal to NULL.
If you ever come to use fprintf, I like to to use sprintf first, see how how successful that was, then use fprintf to write the string in the file. Still check the return value for the fprintf call to see if it worked.
With line 24, the correct way to do something times NumGames is:
1 2 3
|
for (GameCounter = 0; GameCounter < NumGames; GameCounter++) {
// your code
}
|
This will save you one day when you come to use arrays, as your current method will result in over stepping the array boundaries
Two other things to learn from this:
1. Always try to think of what might go wrong - and write code to take care of any reasonable error producing situation. Validating input data goes a long way towards avoiding problems;
2. Always read all the documentation for the functions you are using.
Hope all goes well 8+)