FILE type

Y

yoxoman

Hi,

Is there a reason why the FILE type (from stdio) is written uppercase ?
Is it related to its opaque nature ?

Thanks.
 
K

Keith Thompson

yoxoman said:
Is there a reason why the FILE type (from stdio) is written uppercase ?
Is it related to its opaque nature ?

Macros are conventionally written in all-caps.

I'm not sure of this, but it's possible that the FILE type was first
introduced when typedef had not yet been added to the language.
If so, the original definition might have been something like:

struct __file_info {
/* ... */
};
#define FILE struct __file_info

In modern C it has to be a typedef (there's no permission to define
it as a macro), but the name stuck.

Another distinct possibility is that whoever invented the name
just thought putting it in all-caps would be a good idea. The C
standard library is not noted for being 100% consistent.
 
D

DDD

I think that C may be older than that convention.

Besides the many lower case macros in the C library,
there are also lower case macro examples in the standard
such as str() and xstr().

Maybe like @ as mail symbol. Why using @ but not other char
 
N

Nick Keighley

Keith Thompson wrote:
I think that C may be older than that convention.
Besides the many lower case macros in the C library,
there are also lower case macro examples in the standard
such as str() and xstr().

Maybe like @ as mail symbol. Why using @ but not other char[?]

because it's prnounced "at"

nick keighley AT hotmail.com

The old JANET network used to put addresses before names (seems a
sensible order for a computer), X.400 is just... ik
 
G

gwowen

The old JANET network used to put addresses before names (seems a
sensible order for a computer),

As did UUCP bang paths, for essentially the same reason (users were
better at routing than systems)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,787
Messages
2,569,631
Members
45,338
Latest member
41Pearline46

Latest Threads

Top