在C语言中,stdio.h 头文件是主要的。而在后来的C++语言中,C只是C++的一个子集,且C++中,已不推荐再用C的类库,但为了对已有代码的保护,还是对原来的头文件支持。

   cstdio是c++从C的stdio.h继承来的,在前面加C同时不要H后缀,在C++环境当然是选用前者,两者内容都一样,只是cstdio头文件中定义的名字被定义在命名空间std中。使用后者就会带来额外的负担,需要区分哪些是
标准库明是C++特有的,哪些是继承过来的!!所以在C++中要尽量避免C风格的出现!!

cstdio code:
// cstdio standard header
#pragma once
#ifndef _CSTDIO_
#define _CSTDIO_
#include
 <yvals.h>

#ifdef _STD_USING
#undef _STD_USING
  #include
 <stdio.h>
#define _STD_USING

#else 
#include
 <stdio.h>
#endif 

#define _HAS_CONVENTIONAL_CLIB    1

#define _IOBASE    _base
#define _IOPTR    _ptr
#define _IOCNT    _cnt

#ifndef RC_INVOKED
#if _GLOBAL_USING
_STD_BEGIN
using ::size_t; using ::fpos_t; using ::FILE;
using ::clearerr; using ::fclose; using ::feof;
using ::ferror; using ::fflush; using ::fgetc;
using ::fgetpos; using ::fgets; using ::fopen;
using ::fprintf; using ::fputc; using ::fputs;
using ::fread; using ::freopen; using ::fscanf;
using ::fseek; using ::fsetpos; using ::ftell;
using ::fwrite; using ::getc; using ::getchar;
using ::gets; using ::perror;
using ::putc; using ::putchar;
using ::printf; using ::puts; using ::remove;
using ::rename; using ::rewind; using ::scanf;
using ::setbuf; using ::setvbuf; using ::sprintf;
using ::sscanf; using ::tmpfile; using ::tmpnam;
using ::ungetc; using ::vfprintf; using ::vprintf;
using ::vsprintf;
_STD_END
#endif 
#endif 

#ifndef _Filet
#define _Filet    FILE
#endif 

#ifndef _FPOSOFF
 
 #define _FPOSOFF(fp)  ((long)(fp))
#endif 

#endif 


注:本人正在学习状态,文中多有引用,也有解释纰漏之处,敬请包涵、指正!