Macro/preprocessor handling

arangasoft's Avatar
Light Poster
Hai everybody

i have one question. ie how to define the macro/preprocessor which replace to code whatever string input is given.

for example
if the program like this
Code:
#include<stdio.h>
#define MACRO(_)  (____________________)
main()
{
char a[3][]={
                      "int a,b;",
                      "a=10;b=20;",
                      "printf("a=%d,b=%d",a,b);"
                  };
MACRO(s[0])
MACRO(s[1])
MACRO(s[2])
}
the output will be.....
a=10,b=20

If anyone know the answer please tell me soon.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I dont think anything like that is possible but would like to be proved wrong by some other C/C++ guys.
elec.shabnam's Avatar, Join Date: Feb 2008
Ambitious contributor
sir macros receive values in compile time,so in run time we cannot change,is it right.