By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,743 Members | 804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,743 IT Pros & Developers. It's quick & easy.

Q: Newbee: #include "*.h" - What happened to <>

P: n/a
Dear list

I have found a declaration like this:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include "ectemp.h"

The last line differ from the rest?

I guess it's about where to look for the .h file(s), but can somebody
please make the difference clear...

:-) Martin Hvidberg (Newbee Wannabee)
Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Martin Hvidberg wrote:

Dear list

I have found a declaration like this:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include "ectemp.h"

The last line differ from the rest?

I guess it's about where to look for the .h file(s), but can somebody
please make the difference clear...

Two answers to this.

Answer 1 is informal. Basically, on your implementation (assuming
you're running a typical desktop system) <header> probably means
"look in the usual places where you'd expect to find system headers
and third-party lib headers", and "header" probably means "look in
the current directory first; if not there, search the usual places".

Answer 2 is far less friendly, but rather more accurate!

My 1989 draft says, in 3.1.7:

"The sequences in both forms of header names are mapped in an
implementation-defined manner to headers or external source file names
as specified in $3.8.2."

And 3.8.2 says:

"A preprocessing directive of the form

# include <h-char-sequence> new-line

searches a sequence of implementation-defined places for a header
identified uniquely by the specified sequence between the < and >
delimiters, and causes the replacement of that directive by the entire
contents of the header. How the places are specified or the header
identified is implementation-defined.

A preprocessing directive of the form

# include "q-char-sequence" new-line

causes the replacement of that directive by the entire contents of the
source file identified by the specified sequence between the
delimiters. The named source file is searched for in an
implementation-defined manner. If this search is not supported, or if
the search fails, the directive is reprocessed as if it read

# include <h-char-sequence> new-line

with the identical contained sequence (including > characters, if any)
from the original directive."
Nov 14 '05 #2

P: n/a

<snip> and "snip"

I liked the first ansver better :-) But they both make sense and do ansver
my problem.
Thanks...

:-) M
Nov 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.