valid include formats in C ?

Status
Not open for further replies.

john2020

Full Member level 5
Joined
Nov 13, 2005
Messages
292
Helped
12
Reputation
24
Reaction score
8
Trophy points
1,298
Activity points
4,911
hi

pls help me answer this question,asked for interview
Which of the following are valid include formats?

#include (file.h) and #include "file.h"

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

#include (file.h) and #include <file.h>

#include <file.h> and #include [file.h]

#include [file.h] and #include "file.h"
 

these are valid expressions:
#include <file.h> and #include "file.h"
where
<file.h> file.h is located in the compiler's include directory
"file.h" file.h is located in the local work (your source files) directory


Mik
 
#include <file.h> and #include "file.h"

the first one is that this header file is located in the "default" directory of your IDE or compiler the lastone is that you want to include a headerfile that is attached to the project you are currently building (or in the same directory as the .c file.

I hope this helps you out.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…