If gets() is not working, you can also use getline() function.
Its prototype is : cin.getline(array_or_string_name, no_of_characters_to_read);
Its included in iostream header file...
Cheers