Thread: newbie question: #include <> or ""

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    1

    newbie question: #include <> or ""

    I am newbie in C++. I would like to know which is the difference between:
    #include <file.h>
    #include "file.h"

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    <file.h> = standard header file
    "file.h" = your header file

    (That's what the distinction means to people reading it, anyway. What it means for the compiler is that it looks in different places for the file depending on which it is.)

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Files included like <this> are searched for ONLY in the include path.

    Files included like "this" are searched for first in the current directory, and then in the include path.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A newbie question...i think..
    By AbeMazur in forum C++ Programming
    Replies: 3
    Last Post: 02-24-2009, 12:34 PM
  2. 2d game
    By JordanCason in forum Game Programming
    Replies: 5
    Last Post: 12-08-2007, 10:08 PM
  3. newbie question
    By invisibleghost in forum C Programming
    Replies: 5
    Last Post: 08-23-2005, 12:56 AM
  4. Newbie Question: Can't use #include <string>
    By JohnnyCat in forum C++ Programming
    Replies: 7
    Last Post: 01-07-2005, 02:51 PM
  5. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM