69,371
社区成员
发帖
与我相关
我的任务
分享
http://www.cplusplus.com/reference/cstdio/stdin/
stdin can be used as an argument for any function that expects an input stream (FILE*) as one of its parameters, like fgets or fscanf.
#define STDIN_FILENO 0
typedef struct _iobuf
{
char* _ptr;
int _cnt;
char* _base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char* _tmpfname;
} FILE;
#ifndef __DECLSPEC_SUPPORTED
extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#define _iob (*_imp___iob) /* An array of FILE */
#else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */
#endif /* __DECLSPEC_SUPPORTED */
#define stdin (&_iob[STDIN_FILENO])
stdin是FILE指针数组中的一个元素