Why is std::FILE in capital letters?

隐身守侯 提交于 2019-12-01 05:57:25

问题


I was wondering why C's and C++'s FILE type is spelled with capital letters. Other types are spelled with lower case letters.

Edit see § 27.9.2 of C++11, table 134


回答1:


In very old dialects of C, before there was any of standardization, when the FILE type was invented, and before typedef existed, that name was a macro:

#define FILE struct _iobuf

The convention was to have macros named in all uppercase.

http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/include/stdio.h

(the macros that were in lowercase were simply optimized versions of functions - many of them also existed as proper functions)



来源:https://stackoverflow.com/questions/8281775/why-is-stdfile-in-capital-letters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!