Reputation: 3
I am writing a code for Dots and boxes game in C and I need a function that exit the game and close the window based on an input from the user for example when he presses the letter 'e' on keyboard the game should close and I have no idea how to do that
Upvotes: 0
Views: 90
Reputation: 1093
There are also predefined exit codes EXIT_SUCCESS
and EXIT_FAILURE
#include <stdlib.h>
...
exit(0);
...
e.g. exit(EXIT_SUCCESS);
Upvotes: 1