A couple of things more:

1. In the code you say that your main returns an int, but you are not returning anything from it. So make sure you return an int from the main.

2. The fpurge() function...