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

  • Thread starter Martin Hvidberg
  • Start date
M

Martin Hvidberg

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)
 
I

infobahn

Martin said:
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."
 
M

Martin Hvidberg

<snip> and "snip"

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

:) M
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top