Explaining the code

Preprocessor Directive: “Preprocessor” meaning processed before, and the word “directive” is close to the directory, the term used to describe a place where a file is stored in simple terms. With this in mind, I came to the conclusion that the Preprocessor directive pools information from a library, the library chose depending on what is placed with the <>. before the Main function is run.

Expression statement: Something which is displayed to the terminal.

Declaration Statemeant: Declares a value/ updates / intialies variables

return statement: Because the function has the data type of int, the compiler may expect an int to return. From my knowledge of C# I’ve heard of Void? e.g
void main ()
{

}
I don’t know if Void is able to work in C++, would be helpful if it could.

1 Like

Hi,
The Preprocessor directive is actually a command that is processed by the compiler before the code is compiled. Directive is just a fancy word for command. The directives you’ve encountered are related to include files but there are a number of other ones such as #define, #pragma and #if which alter the way the compiler behaves before compiling the code.

I hope this helps.

Privacy & Terms