Difference between Macros and Functions in C | Comparing macros & function in C | C language macro, User Defined Functions, PDF, Macros in C | Working of Function and macro in C Programming

Difference between Macros and Functions in C | Comparing macros & function in C | C language macro, User Defined Functions, PDF, Macros in C | Working of Function and macro in C Programming 

 


Macros
Functions
Macro calls are replaced with macro expansions (meaning).

In function call, the control is passed to a function definition along with arguments, and definition is processed and value may be returned to call
Macros run programs faster but increase the program size.
Functions make program size smaller and compact.
If macro is called 100 numbers of times, the size of the program will increase.
If function is called 100 numbers of times, the program size will not increase.
It is better to use Macros, when the definition is very small in size.
It is better to use functions, when the definition is bigger in size.


Related Links :

No comments:

Post a Comment


If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE


More Useful Topics...

 

History Of C..

In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.

My 1st Program...


#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t*******Pankaj *******\n");
printf ("\t\t\t********************************\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}

Next Step...


#include
#include

void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");

printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");

getch ();

}

Hits!!!