delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/06/01:01:25

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: #include "..." versus <...>
Date: Sat, 05 Jul 1997 16:47:45 -0700
Organization: Alcyone Systems
Lines: 42
Message-ID: <33BEDD21.53282D93@alcyone.com>
References: <5pm0v8$45io AT elmo DOT cadvision DOT com>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Calvin French wrote:

> I have noticed that <...> allows for directories, whereas if I recall
> "..."
> doesn't pay attention to directories, or something like that.

The ANSI C standard (section 6.8.2) doesn't say anything about the
filename contained in the double quotes or angle brackets; in fact, it
states that the difference between these two is implementation defined
(and that if the #include "..." form fails, it is retried as #include
<...>).

> Really, i
> have
> to keep part of my program in separate directories and some files have
> the
> same names. Previously I used <...>, but now I have switched to "..."
> because I understand that "..." is more for dynamically-changing files
> (i.e., non-standard or libraried includes) wherease <...> is more for
> standard library includes.

Typically and almost universally, #include <...> is used for include files
in a standard place (e.g., /usr/include under Unix, or in compiler
directories under other operating systems).  #include "..." is used for
include files that are local to a project.

> This is all very strange to me. What's the diff
> here? I'd rather just use "..." with header files specific to the
> particular
> application at hand, and <...> to those which can be considered for the
> most
> part static.

This is the usual way things are done.

-- 
       Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
                     Alcyone Systems /   web / http://www.alcyone.com/max/
San Jose, California, United States /  icbm / 37 20 07 N  121 53 38 W
                                   \
           "All the gods are dead / except the god of war."
                                 / Eldridge Cleaver

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019