0
What are prototypes and directives in c++?
I can't understand it.
1 Answer
+ 2
A prototype is a declaration of a function that tells you the return type of the function, the name of the function and the types and number of arguments the function can receive. I call it the skeleton of a function because it does not tell you anything about how the function is implemented. eg of prototype is shown on immortal's post.
A directive is an informal command that is not executed as c++ code but as a compiler instruction. it is used to import libraries, eg the #include preprocessor directive, to create macros and symbolic constants eg the #define directive, to avoid multiple inclusions of a header eg the #if, #ifndef, #endif, #elseif and many others like the #pragma directive