Re: '#include<stdio.h>' (without space) or '#include <stdio.h>' (with space)?
- From: RideEngineer <engineer929@xxxxxxxxx>
- Date: Mon, 4 Jan 2010 23:23:45 -0600 (CST)
On Jan 4, 10:23 am, Jorgen Grahn <grahn+n...@xxxxxxxxxxxxxx> wrote:
On Mon, 2010-01-04, Peng Yu wrote:
It seems that "#include <stdio.h>" is widely used and I don't see many
real examples of "#include<stdio.h>" (without the space).
http://www.chris-lott.org/resources/cstyle/indhill-cstyle.html
"#include<stdio.h>" is also perfect legal in the current compile (I
use gcc 4.2.4 default options).
Why on earth do you do that?
"Default options" (which I read as "no options passed to the
compiler") means to gcc and other compilers "turn off various kinds of
warnings for illegal code, and silently accept all kinds of C language
dialects and odd extensions".
Asking questions here based on such experiments is normally a waste of
time. (In this specific case it makes no difference.)
I know that this is a minute
difference. But I'm still wondering why "#include<stdio.h>" is not the
popular case. Is it because that "#include<stdio.h>" was illegal (at
lease in K&R's book, I don't see an example use "#include<"), but
later on the C language grammar was relaxed?
People add spacing to their code to make it more readable. That is
surely the original reason you don't see #include<foo> or
#include"foo".
For those of us who started writing C code after 1975, I suspect the
reason is: everyone else adds spacing, so why should *my* code look
odd for no good purpose?
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
--
comp.lang.c.moderated - moderation address: c...@xxxxxxxxxxxx -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Adds style and readability to code.
--
comp.lang.c.moderated - moderation address: clcm@xxxxxxxxxxxx -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
.
- References:
- Prev by Date: Re: is fgets( ) guaranteed atomic?
- Next by Date: What are the error handling method in C?
- Previous by thread: Re: '#include<stdio.h>' (without space) or '#include <stdio.h>' (with space)?
- Next by thread: Are the number of predefined 'errno's the same across platforms? How to avoid clashing of 'errno's from different libraries?
- Index(es):
Relevant Pages
|