Hello
I am just testing how to get the fatorial of a number by using MACRO -
Here is my wrong code -
#include <stdio.h>
#include <conio.h>
#define FAC(n) for(typeof(n) i=2; i<=n; i++){f *= i}
void main()
{
int i=5;
int j=FAC(i);
printf("%d",j);
getch();
}
And these are error
Error MACRO.C 7: Expression syntax
Warning MACRO.C 7: Code has no effect
Error MACRO.C 7: Statement missing;
How can I use for loop in Macro please guide me.
Thank you