共用方式為


<cstdio>

定義傳統上定義標準的 c 程式庫標頭 <stdio.h> 中的巨集。

#if <TRADITIONAL C HEADERS>
   #include <stdio.h>

#undef clearerr
#undef feof
#undef ferror
#undef getc
#undef getchar
#undef putc
#undef putchar

namespace std {
   using ::fclose; 
   using ::feof;
   using ::ferror; 
   using ::fflush; 
   using ::fgetc;
   using ::fgetpos; 
   using ::fgets; 
   using ::FILE;
   using ::clearerr; 
   using ::fopen;
   using ::fprintf; 
   using ::fpos_t;
   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 ::size_t;
   using ::sprintf;
   using ::sscanf; 
   using ::tmpfile; 
   using ::tmpnam;
   using ::ungetc; 
   using ::vfprintf; 
   using ::vprintf;
   using ::vsprintf;
}
#endif

備註

包括此標頭檔也可確保使用標準的 c 程式庫的標頭中的外部連結所宣告的名稱宣告在標準命名空間。 在此實作中,名稱也不也可以宣告全域命名空間,視特定轉譯的環境中。

請參閱

參考

標準 C++ 程式庫概觀

在標準 C++ 程式庫中的執行緒安全

其他資源

標頭檔