특정 버전 이후부터는 아예 없어져 버린 거 같네요.
gets 함수에 대해서 찾아보시면 이렇게 나올 거에요.
The most recent revision of the C standard (2011) has definitively removed this function from its specification.
The function is deprecated in C++ (as of 2011 standard, which follows C99+TC3).
leehosu01 5년 전 1
서버 컴파일 에러 결과 입니다.
왜 이럴까요 ??????????????????
/*
Main.cc: In function ‘int main()’:
Main.cc:16:5: error: ‘gets’ was not declared in this scope
gets(S);
^~~~
Main.cc:16:5: note: suggested alternative: ‘fgets’
gets(S);
^~~~
fgets
Main.cc:47:33: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::vector<int>::size_type {aka long unsigned int}’ [-Wformat=]
printf("%d\n", result.size());
~~~~~~~~~~~~~^
*/