When you run a program, it creates a process for that program. So when you call exit within that process, the os kills that process and cleans up memory. As for its actual implementation, I do not know. It is most likely implementation specific, that is I don't think there would be one set of implementation that all would follow. But as homework you can create your own exit function using winAPI, by manually deleting the associated process. Other than that, I don't believe you should worry about its details too much.
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124