#include #include #include using namespace std; int main() { char str[30]; gets(str); }
when
gets is an unsafe function and is not supported by the C Standard any more.
gets
Instead use fgets.
For example
#include #include #include int main() { char str[30]; std::fgets(str, sizeof( str ), stdin ); str[ std::strcspn( str, "\n" ) ] = '\0'; //... }