gets

連続1行入力の基本パターン

#include <stdio.h>
void main()
{
 char s[256];
 while ( ( gets( s ) ) != NULL )
  puts( s );
}


getsによる入力の終了はNULLで知る事ができる。
C > 標準関数 > コンソール入出力関数 | comments (0) | trackbacks (0)

Comments

Comment Form

icons:

Trackbacks