私のコンパイラ(gccが)警告(!ないエラー)fp
を宣言するライン上をスロー:は、コンパイラの警告を解釈することはできません
int fd = open("filename.dat", O_RDONLY);
FILE* fp = fdopen(fd, "r"); // get a file pointer fp from the file descriptor fd
これらは警告です:
main.c: In function ‘main’:
main.c:606: warning: implicit declaration of function ‘fdopen’
main.c:606: warning: initialization makes pointer from integer without a cast
は、私はこれらを理解していません戻り値fopen
はFILE*
であるため、警告が表示されます。私がここで作っている間違いは何ですか?
EDIT:私はstdio.h
を含んでいます(そして私もLinuxです)。
と完全に準拠して? – robert
@robert:stdio.h、stdlib.h、string.h、errno.h、unistd.h、sys/types.h、sys/stat.h、fcntl.h – pap42
'man fdopen'は、持っていない? – robert