found the problem, the program wasn't stoping at the end so it just closed. I fixed it by adding: system (pause) to the end. Thanks for your help.