You are passing to gets an uninitialized pointer. So gets tries to write its output to some weird memory location. That's what the "Access violataion" comes from.
Allocate a buffer for the line that you want to read and pass that buffer to gets, for example:
char lineBuffer[200];
gets (lineBuffer);
Just as a note for the time when you are getting more advanced in C++: There are better ways to read a line than gets. gets has the disadvantage that you can't tell it, how long your buffer is; and if your input is long enough it therefore overwrites the buffer end and corrupts your memory.