i want to know how and when can i use exit() function..like i had a programme written in book..
#include<stdio.h>
void main()
{
int goals;
printf("enter number of goals scored");
scanf("%d",&goals);
if(goals<=5)
goto sos;
else
{
printf("hehe");
exit( );
}
sos:
printf("to err is human");
}
But when I run it, it shows error that call to undefined function exit().. Since I'm a beginner in c language so kindly help me out.. Also I want to know that if within a programme I want to close the window in which the whole programme runs..how can i do that.for e.g. I made a menu driven programme which had several option and one of them was "exit the menu"...And when I opt for exit option the programme shall stop working..i.e. the window shall close... kindly help..if u get what I'm saying.. :(