Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
1.1k views
in Computer by (69.2k points)

What are preprocessor directives? List three types of them. What is the difference between the following directives: #include and #include “filename”? 

1 Answer

+1 vote
by (70.0k points)
selected by
 
Best answer

Preprocessor directives: These are the commands given to a program known as preprocessor that processes the source code before it passes through the compiler. Each of these preprocessor directives begins with a # symbol. These can be placed anywhere in the program but usually placed before main ( ) or at the beginning of the program. Before the source code passes through the compiler, it is examined by the preprocessor for any directives. If there are any, appropriate action is taken and the source program is handed over to compiler. These directives can be divided into following three categories:

1. Macro substitution directives

2. File inclusion directives.

3. Compiler control directives.

#include “filename”: The search for the file is made first in the current directory and then in the standard directories as mentioned in the include search path.

#include : This command would look for the file in the standard list of directories.

Both of these directives cause the entire contents of filename to be inserted into the source code at that point in the program. 

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...