DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Difference in incuding header files?

  1. #1
    Join Date
    May 2007
    Posts
    52

    Difference in incuding header files?

    Can someone explain the difference between

    # include<stdio.h>
    and
    # include "stdio.h"

    I am a newbie. So pls. explain it simple & clear.

  2. #2
    Join Date
    Nov 2003
    Posts
    4,118
    As per the standard, <xxx.h> and <xxx> are reserves for standard library headers, and "xxx.h" are for user-defined headers. In reality, many implementations freely confuse the two. There is also a difference with respect to the default search path, so the best idea is to stick to <xx.h> when dealing with standard headers.
    Danny Kalev

  3. #3
    Join Date
    May 2007
    Posts
    52
    Can you explain in detail about the difference in the search path used by both?

  4. #4
    Join Date
    Dec 2003
    Posts
    3,366
    its complex.

    your IDE like visual studio can have a ton of folders to search in the project settings. At the simplest, the defaut for "" includes is just the place where the project file is, (usually where main.cpp is, or whatever you named it). The <> includes can also be many places, but these are determined by the installer for your IDE and the compiler simply knows where to look (although you can point it elsewhere, if you have a very good reason, like an alternate stl or math implementation etc).

  5. #5
    Join Date
    Jan 2008
    Posts
    4
    <stdio.h> can use standard header file. "stdio.h" like this the header file in commas are user defined header files. If user wants to use other programm in it so it can use it by adding this programm as a header file. But the both way are same.

Similar Threads

  1. structs and header files...
    By Greggle in forum C++
    Replies: 6
    Last Post: 05-03-2007, 07:35 AM
  2. Using C header files in Java
    By phalanxmsu in forum Java
    Replies: 1
    Last Post: 12-23-2005, 05:43 AM
  3. Header Files compared to Java
    By ZeroFear in forum C++
    Replies: 8
    Last Post: 11-18-2005, 08:44 AM
  4. Replies: 8
    Last Post: 04-02-2005, 02:06 PM
  5. Replies: 0
    Last Post: 06-10-2002, 09:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center