answersLogoWhite

0

What is a preprocessor?

Updated: 8/11/2023
User Avatar

Wiki User

15y ago

Best Answer

A preprocessor is a program that proccesses a file before it's passed down to the compiler and the linker. It permits to define some variables so that a programmer can change the program just by changing one line of code. It permits to include header files to.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

The pre-processor is as its name implies; it changes or processes the source code of the programmer in certain ways before the compiler actually sees the code to compile. For example, if I have the following:

# define VAL 5

if (abc 5)

so it has "pre-processed" the statement before the compiler.

Another common reason for using a pre-processor is to bring in lines of code to describe a feature or function that is used commonly without having to re-write the code over and over. This is the result of using the # include statement.

There are other statements, such as #pragma, #ifdef, etc.,that can cause conditionalized code to be included or not, depending on environment, etc.

The program I work on must compile on multiple platforms; some times parts of the code would only compile under Windows, some times only under certain Unix platforms. The pre-processor allows me to keep a common set of code for all platforms.

A very useful feature ...

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

It's a command for the preprocessor. This makes perfect sense if you know what a preprocessor is, but otherwise probably not a lot.

In computer science, a preprocessor is a program that reads source code and makes certain changes to it before handing the result off to a compiler. The point of the preprocessor is to make writing code simpler, by allowing people to (for example) include the contents of a different file inside the file actually being processed, or to define a 'shortcut' for some expression that may be used several times in the program, saving the coder from having to write it out in full each time.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a preprocessor?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a preprocessor in PHP?

As it is, PHP does not have a preprocessor; it is a preprocessor that processes form variables and other environmental variables and prints HTML or general text.


Why all preprocessor directives starts with hashmark?

Because otherwise the preprocessor would ignore them.


What is Hypertext Preprocessor related too?

Hypertext Preprocessor is PHP, it is a server side web programming language.


What is the difference between preprocessor directives and header files?

Preprocessor: All the preprocessor commands written in a high level language are processed by the preprocessor before compiler takes over.Example: "#define MAX_ROWS 10"Preprocessor finds all the places and replaces MAX_ROWS with 10 in the files of the project.Compiler: This software, converts the code written in high-level language into object file. Compiler converts all the files of a given project at once.


What is the abbrevation of php?

PHP: Hypertext Preprocessor


What is php fullform?

"PHP: Hypertext Preprocessor".


In C plus plus what sign do all preprocessor directives start with?

all preprocessor directives start with #(hash) symbol in both c & c++


Does header contains preprocessor directive?

Yes, it often does.


What is the full form of php language?

PreProcessor Hyptertext


How do you set global variables to on?

You can use the preprocessor directive #define, or you can describe a variable in the body of main(). With the preprocessor directive you can make the variable accessible even out of your current project.


Is macro a recursive function?

If you're asking if the c preprocessor supports recursive macros, the answer is no. The preprocessor is single-pass and since the "function" must be defined before it can be referenced, it can not be recursive.


Can you declare any variable above preprocessor directive?

Yes.