What are Macros in C? Macros/preprocessor directives-Important topic in C programming language-computer science/Information technology
Macros are preprocessor directives in C, a very important topic in C, are used at the top of the C program. It is nothing but a constant value that you have to declare at the starting of the program.
->Watch this for FUN - Funny job interview
Are you getting bored with online lectures?
->Watch this - When online lectures are boring
For example,
#define P 11.20
Here if you use P in any part of the program then it is nothing but 11.20.
It should be define on the top,
#include<stdio.h>
#define P 11.20
int main()
{
//code
}
There are some major pre-defined macros which you can use in the program.
_ _ DATE _ _ For the current date.
_ _ TIME _ _ For the current time.
_ _ FILE _ _ For getting the current file name.
_ _ LINE _ _ For getting the current line number.
And even you can define the function in macros as,
#define ADD(a,b) a+b
where just use ADD(a,b), it will return a+b in the value.
Are you getting bored with online lectures?
Watch this - When online lectures are boring
Watch this for FUN - Funny job interview
<><><><><><><>
<><><><><><><>
Comments
Post a Comment