the link above contain the code that i wrote for a class project.I have a question about the output file for this code.The output file was created but was empty why is this happen ?
I don’t see anything wrong with the output function.Could it be that I did something wrong in the other functions?
thank you
here is the data for the code
LYSACEK Evan
1 7.5 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
2 10.0 1 2 2 1 1 1 1 2 0 1 1 1
3 3.0 1 2 2 2 1 0 1 2 1 1 1 2
4 3.1 1 1 1 1 1 0 0 0 1 0 1 0
5 1.7-3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
6 2.1 0 0 1 1 1 1 1 1 1 1 1 1
7 3.1 0 0 1 1 0 0 1 1 1 1 1 1
8 3.5 0 1 1 2 1 1 1 1 1 1 0 1
WEIR Johnny
1 7.5 2 2 2 2 1 1 1 1 1 2 1 1
2 10.0 1 1 1 1 2 0 1 1 1 1 2 1
3 3.0 1 1 1 2 1 0 1 1 2 2 2 2
4 3.1 1 2 1 2 1 1 0 0 2 1 1 0
5 5.5 0 -1 0 -1 -1 0 -1 -1 1 -2 -2 -2
6 1.3 1 1 1 2 1 1 1 0 1 1 1 2
7 3.1 0 1 1 1 1 0 0 1 2 1 1 1
8 3.0 -1 1 1 2 1 0 1 0 2 1 -1 1
PLUSHENKO Evgeni
1 13.0 0 2 1 1 1 0 1 0 1 1 1 1
2 7.5 1 2 2 2 2 1 2 1 2 2 2 2
3 6.0 2 1 1 1 1 0 0 2 1 2 1 2
4 2.3 2 1 1 1 1 1 2 1 1 1 1 1
5 3.4 2 2 2 2 1 2 3 3 2 3 2 1
6 2.1 1 1 1 2 2 0 0 0 1 2 1 1
7 3.1 1 0 2 2 1 1 1 2 2 2 2 1
8 3.5 1 1 2 2 1 1 1 1 2 2 1 1
SAVOIE Matthew
1 3.0 0 0 0 1 0 0 0 0 0 0 0 -1
2 7.5 1 2 2 1 1 1 1 1 1 1 2 2
3 9.5 0 1 1 0 0 0 0 0 0 0 1 1
4 3.1 1 1 1 1 1 1 0 0 1 1 0 0
5 1.9 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
6 2.1 0 0 1 0 1 0 0 1 1 1 1 1
7 3.1 0 0 1 0 0 0 1 1 2 0 2 1
8 3.0 0 0 1 1 1 0 1 1 1 1 1 1
You need to close
fpOutfile handle usingfclose. Otherwise the content might not be written to disk before your program finishes.Hints:
"output.txt"fpOut = stdout;just to check that the output is printed on the console.Output:
On my system, running your code with your input.