LoginSignup
1
1

More than 5 years have passed since last update.

gets() > 改行文字かファイル終端(EOF)に達するまで読込みを行う | C99では非推奨

Last updated at Posted at 2015-04-20

gets()の例

sample.c
#include <stdio.h>
#include <stdlib.h>

int main()
{
   char buf[20];

   printf(">");
   gets(buf); 
   ...
}

以下、引用: C/C++ セキュアコーディング 第2版 by Robert C. Seacordら

gets()はC99では使用が推奨されておらず、C11からは削除されている。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1