what's the different

Q

QQ

When I include a header file
what's the difference between "" and <>

for example
include <a.h>
and

include "a.h"

No difference?

Thanks a lot!
 
S

Sarath

There is a difference !

When u include a file like <> it means that the file is present in the
default loction of C- library files . But when u include a file with "
" then the file is assumed to be present in the current directory from
where the program is compiled and run. If that file is not in the
current directory then u have to write the path to that file in within
the inclue statement itself.

i.e., like

# include "c:/mylib/a.h"

I hope ur doubt is resolved.

Sarath.B
 
W

Walter Roberson

There is a difference !
When u include a file like <> it means that the file is present in the
default loction of C- library files . But when u include a file with "
" then the file is assumed to be present in the current directory from
where the program is compiled and run.


That is not correct, Sarath. When you use "" then the system
directories are still examined, but the current directory is
examined first.
 
B

Barry Schwarz

When I include a header file
what's the difference between "" and <>

for example
include <a.h>
and

include "a.h"

On those systems where the header files are actually files, the <>
notation indicates that the file should be found in the **standard**
location while the "" notation indicates the file should be found in a
"user specified" location.


<<Remove the del for email>>
 
L

Lawrence Kirby

That is not correct, Sarath. When you use "" then the system
directories are still examined, but the current directory is
examined first.

The standard doesn't say "current directory" specifically. The "" form
searches an "implementation-defined manner" and if that fails it then
searches as if the <> form was used. It is certainly true that the
"implementation-defined manner" typically involves a current directory.

In practical terms this means that you should use the <> form for system
headers or library headers that aren't part of your application code, and
the "" form for headers that are part of your code.

Lawrence
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top