When working with text file input and output (or any I guess) what happens if the close() is omitted? Is it similar to a memory leak, or creates a corrupt file (did not do this when I experimented), or what?
Depends, really. In most situations, it will fall out of scope, and the default deconstructor will be called, the object holding that memory will be destroyed, and you will be fine. It shouldn't corrupt the file, the only way I could see that happening is if mid write to file the object got destroyed, and in most cases that still shouldn't cause file corruption to a text file.
The file will be automatically closed when the stream goes out of scope. However, if the stream does not go out of scope and you use std::exit() to terminate the program, the stream may not be flushed properly because destructors for automatic variables do not get called. This may prevent the buffers from being flushed to the file. This is the only time I have encountered corruption due in part to not closing a file (or letting the stream go out of scope when I'm done with it).