For the record, gets() has been depreciated in the ISO C99 C Standard, and has been removed completely from C11 Standard.
fgets() is recommended for imputing Stings in C. You will need to deal with the trailing '\n' newline char at the end of the String.
scanf() does not handle inputting strings with spaces without extra work.
Mickey$oft's problems extend way beyond the possible use of gets()! There are too many ways out-of-bounds errors can occur, on the stack, on the heap, static data, etc... without proper bounds checking code.