मेरे संकलक संकलक की व्याख्या नहीं कर सकता (जीसीसी) लाइन, जिसमें यह घोषणा पर फेंकता चेतावनी (नहीं त्रुटियों!) fp
:चेतावनी
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
मैं इन समझ में नहीं आता:
int fd = open("filename.dat", O_RDONLY);
FILE* fp = fdopen(fd, "r"); // get a file pointer fp from the file descriptor fd
ये चेतावनी है fopen
के वापसी मूल्य के बाद से चेतावनियां FILE*
है। मैं यहां क्या गलती कर रहा हूं?
EDIT: मैं stdio.h
(और मैं भी लिनक्स पर हूं) समेत हूं।
क्या आप '# include'-इंग कर रहे हैं? – robert
@robert: stdio.h, stdlib.h, string.h, errno.h, unistd.h, sys/type.h, sys/stat.h, fcntl.h – pap42
क्या 'मैन fdopen' किसी हेडर को सूचीबद्ध करता है नहीं है? – robert