What is macro?

Answer Posted / rohit

macro is a subroutine.
A macro is used to define a short functional code where it
can be inserted in a number of places(where the functional
code is compiled more than once)
Need of Macro: Some times there is a need to call the set
of codedata again and agian in the program.In that
particular situation we can use macros.
Use of Macro can increase the efficiency of the program and
also decrease the length of the code.
Macro can be defined by using Define statement
Example:

int a[2000];
If you use lot of places 2000 in your code
some time you want to change the 2000 to 500
then you must replace 2000 with by 500. this changes are
repeatedly by u....
In this case if you define macro
Just you change the macro it will effect over all program..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

2528


With the help of using classes, write a program to add two numbers.

615


What are the disadvantages of c language?

614


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

595


What does c mean before a date?

585






Array is an lvalue or not?

631


What is #include stdio h?

677


Why clrscr is used in c?

575


What are global variables and explain how do you declare them?

567


Difference between exit() and _exit() function?

651


What are the different types of endless loops?

615


Explain how can you tell whether two strings are the same?

580


main() { printf("hello"); fork(); }

689


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

608


write a program to concatenation the string using switch case?

1551