You need to look in the source code of the C library.
Since you mention gcc and Linux, you are probably using GNU libc, which of course is free software.
This file says:
typedef struct _IO_FILE __FILE;
And this file declares the _IO_FILE structure:
struct _IO_FILE { int _flags; #define _IO_file_flags _flags char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; #if 0 int _blksize; #else int _flags2; #endif _IO_off_t _old_offset; #define __HAVE_COLUMN unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; #ifdef _IO_USE_OLD_IO_FILE };
Most likely, the aforementioned one, coming from a “real” library of production quality, is a little more complicated than the example used in K & R. And of course you cannot use this, since the library is internal and FILE is an opaque type, as they say.
unwind Jun 20 '13 at 8:52 2013-06-20 08:52
source share