stdio.h,io.h,STDLIB.h简单说明

stdio.h,io.h,STDLIB.h简单说明

编者:李国帅

qq:9611153 微信lgs9611153

时间:2006-11-15

背景原因:

能力不够字数来凑,简单说明三个常用头文件。来自旧日志。

三个文件位于

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include

stdio.h定义c标准输入输出:

主要定义系统对标准输入,标准输出,标准错误流的操作.

 

This file defines the structures, values, macros, and functions used by the level 2 I/O ("standard I/O") routines. [ANSI/System V]

typedef unsigned __int64    size_t;

typedef unsigned short wchar_t;

struct _iobuf {

        char *_ptr;//缓冲区

        int   _cnt;

        char *_base;

        int   _flag;

        int   _file;

        int   _charbuf;

        int   _bufsiz;

        char *_tmpfname;//文件名

        };

typedef struct _iobuf FILE;

FILE *fp;

 

_CRTIMP extern FILE _iob []

#define stdin  (&_iob[0])

#define stdout (&_iob[1])

#define stderr (&_iob[2])

io.h 低级别IO操作:

--- This file contains the function declarations for the low-level.file handling and I/O functions.

typedef __int64             intptr_t;

typedef __int64   time_t;       /* time value */

struct _finddata_t {

        unsigned    attrib;

        time_t      time_create;    /* -1 for FAT file systems */

        time_t      time_access;    /* -1 for FAT file systems */

        time_t      time_write;

        _fsize_t    size;

        char        name[260];

};

_CRTIMP int __cdecl _access(const char *, int);

_CRTIMP int __cdecl _chmod(const char *, int);

_CRTIMP int __cdecl _chsize(int, long);

_CRTIMP int __cdecl _close(int);

_CRTIMP int __cdecl _commit(int);

_CRTIMP int __cdecl _creat(const char *, int);

_CRTIMP int __cdecl _dup(int);

_CRTIMP int __cdecl _dup2(int, int);

_CRTIMP int __cdecl _eof(int);

_CRTIMP long __cdecl _filelength(int);

_CRTIMP intptr_t __cdecl _findfirst(const char *, struct _finddata_t *);

_CRTIMP int __cdecl _findnext(intptr_t, struct _finddata_t *);

_CRTIMP int __cdecl _findclose(intptr_t);

_CRTIMP int __cdecl _isatty(int);

_CRTIMP int __cdecl _locking(int, int, long);

_CRTIMP long __cdecl _lseek(int, long, int);

_CRTIMP char * __cdecl _mktemp(char *);

_CRTIMP int __cdecl _open(const char *, int, ...);

_CRTIMP int __cdecl _pipe(int *, unsigned int, int);

_CRTIMP int __cdecl _read(int, void *, unsigned int);

_CRTIMP int __cdecl remove(const char *);

_CRTIMP int __cdecl rename(const char *, const char *);

_CRTIMP int __cdecl _setmode(int, int);

_CRTIMP int __cdecl _sopen(const char *, int, int, ...);

_CRTIMP long __cdecl _tell(int);

_CRTIMP int __cdecl _umask(int);

_CRTIMP int __cdecl _unlink(const char *);

_CRTIMP int __cdecl _write(int, const void *, unsigned int);

 

STDLIB.H 定义c语言最常用的函数和宏:

包括类型转换,应用程序操作控制,内存分配,参数类型说明

#define EXIT_SUCCESS    0

#define EXIT_FAILURE    1

#define _MAX_PATH   260 /* max. length of full pathname */

#define _MAX_DRIVE  3   /* max. length of drive component */

#define _MAX_DIR    256 /* max. length of path component */

#define _MAX_FNAME  256 /* max. length of file name component */

#define _MAX_EXT    256 /* max. length of extension component */

 

errno_t __cdecl _set_errno(_In_ int _Value);

errno_t __cdecl _get_errno(_Out_ int * _Value);

_CRTIMP __declspec(noreturn) void __cdecl exit(_In_ int _Code);

_Check_return_ _CRTIMP double  __cdecl atof(_In_z_ const char *_String);

_Check_return_ _CRTIMP __int64 __cdecl _atoi64(_In_z_ const char * _String);

_Check_return_ _CRTIMP double __cdecl _wtof(_In_z_ const wchar_t *_Str);

inline long abs(long _X)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

微澜-

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值