B
BiGYaN
I am not an expert in C, but from all the C code I've seen in my last
4yrs of coding in C, I observe that programmers only use only "FILE *"
type and never the actual "FILE" type. So my question is :
<1> what is the actual use of this structure; i.e. can it be used
anywhere in general programming? It is of course a very important
structure, but can we make use of it a standard C program? I am told
that using internals of this structure is not encouraged.
<2> instead of having,
typedef struct _iobuf
{
char* _ptr;
int _cnt;
char* _base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char* _tmpfname;
} FILE;
the stdio.h could have contained a type "pointer to FILE". This would
save us writing the * every time.
4yrs of coding in C, I observe that programmers only use only "FILE *"
type and never the actual "FILE" type. So my question is :
<1> what is the actual use of this structure; i.e. can it be used
anywhere in general programming? It is of course a very important
structure, but can we make use of it a standard C program? I am told
that using internals of this structure is not encouraged.
<2> instead of having,
typedef struct _iobuf
{
char* _ptr;
int _cnt;
char* _base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char* _tmpfname;
} FILE;
the stdio.h could have contained a type "pointer to FILE". This would
save us writing the * every time.