I want to know how and when can I use the exit() function like the program in my book:
#include
void main()
{
int goals;
exit(int code); is declared in stdlib.h so you need an
#include
Also:
- You have no parameter for the exit(), it requires an int so provide one.
- Burn this book, it uses goto which is (for everyone but linux kernel hackers) bad, very, very, VERY bad.
Edit:
Oh, and
void main()
is bad, too, it's:
int main(int argc, char *argv[])