You are here:

C++/difference of <> and " "

Advertisement


Question
sir,

when im includeing a header file for eg #include<stdio.h>
and also as #include"stdio.h" both are succesfully compiled. what is the diffence of <> and " " then?
please help

Answer
for a #include <header_name> new-line

searches a sequence of implementation-defined places for a header identified uniquely by 'header_name'. typically this looks in a set of directories where standard implementation supplied headers reside.


for a #include "header_name" new-line

typically searches the current directory for a header identified uniquely by 'header_name'. if this fails, it searches for this header as in the case using <>

#include <stdio.h> looks in the default include directories for your implementation for a header identified by 'stdio.h'

#include "stdio.h" looks in the current directory for a header identified by 'stdio.h'. if it does not find it (in your case it does not), it proceeds as if the directive was #include <stdio.h>  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


vijayan

Expertise

my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++11. i would not answer questions about gui and web programming.

Experience

about 15 years or so

Education/Credentials
post graduate engineer

©2016 About.com. All rights reserved.