Advertisement

"" or <>

Started by August 15, 2001 10:15 PM
4 comments, last by marvano 23 years, 6 months ago
hi, what''s the difference between: #include "file.h" #include #include file.h thanks.
"" looks in the current directory.
<> looks in the system's include directory.

~~~~~~~~~~
Martee

Edited by - Martee on August 15, 2001 11:20:14 PM
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Advertisement
Quoted form "" tells the compiler to look for the header file in the same directory as the source file that called it

Angle-bracket form <> tells the compiler to look in the default include directory (you''d use <> for including stuff like windows.h)
You can also specify paths here as well such as:
  #include "graphics/shapes/triangle.h"  


I think most compilers (but not all) actually search both places no matter whether you use brackets or quotes. The key difference is the order they search them in. If you use quotes, the application directory is searched first, and if you use brackets, the compiler''s include directory is searched first.
Depends on your IDE, I guess. Code Warrior allows you to specify system paths and user paths. Angle brackets search only in the system path, quotes search the user path and then the system path ... why waste time searching for system headers outside the system headers?

Can''t remember what the standard UNIX procedure is, maybe what kylotan said.

--


Games, Anime and more at GKWorld

Meet Bunny luv'' and the girls, ready to perform on your desktop just for you (warning: adult content).

This topic is closed to new replies.

Advertisement