2008-10-16 fgets確認 プログラム 改行までを読みます。 printfで表示されるのは「#include 」です。 #include <stdio.h> // test int main() { FILE *fp; char line[30]; fp = fopen("a.c", "r"); if(fp == NULL){ printf("file not found"); return 1; } fgets( line, sizeof(line), fp); printf(line); return 0; }