title: deallocating memory when using exit(1), c++
body: <p>I am working on a school assignment, and we were told that whenever we have an input
  error we should print a message and exit the program. Obviously I use exit(1), but
  the problem is I have memory leaks when using this functions. I don't understand why - every single variable I've used was on the stack and not on the heap.</p>
  
  <p>What should I do to prevent those memory leaks?
  Thanks!</p>