Menu

FILE * and what it means

bitshadow
2008-03-11
2012-09-26
  • bitshadow

    bitshadow - 2008-03-11

    i need to find out what the various members in the FILE struct as defined in <stdio.h> are and was wondering if anyone here would have any idea. the struct:

    typedef struct _iobuf
    {
    char _ptr;
    int _cnt;
    char
    _base;
    int _flag;
    int _file;
    int _charbuf;
    int _bufsiz;
    char* _tmpfname;
    } FILE;

     
    • cpns

      cpns - 2008-03-11

      Don't even think about it. If you think that you need this information, you are thinking wrong.

      The FILE structure may indeed be defined as above in your particular library for your particular compiler. The implementation of FILE is entirely implementation dependent, and as such making use of knowledge of its internals will lock your code to that specific version of that specific library on that specific platform.

      A better way to approach this is to tell us what you need to actually do, and perhaps someone can tell you the 'right' way.

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.