Some variables need to be cleared (or something similar); dynamic arrays declared with new must be delete ed, ofstreams must have .clear(), mpfr-variables must have mpfr.clear() and so on. When I use ctrl-c, are these implemented or does it mess up the memory or something?
ctrl-c has nothing whatsoever to do with the values of variables. It's a keyboard command and what it does will depend entirely on the OS and the program running.
If you're asking "what happens to my programs memory if I end the program suddenly" the answer is that in a modern system, the OS takes back all the memory and it's not something you have to worry about.