Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is std::FILE in capital letters?

Tags:

c++

c

naming

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

like image 231
Johannes Schaub - litb Avatar asked Nov 26 '11 21:11

Johannes Schaub - litb


1 Answers

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)

like image 142
Random832 Avatar answered Nov 07 '22 22:11

Random832