Macro/preprocessor handling

Light Poster
27Nov2004,18:14   #1
arangasoft's Avatar
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.
Go4Expert Founder
28Nov2004,07:32   #2
shabbir's Avatar
I dont think anything like that is possible but would like to be proved wrong by some other C/C++ guys.
Ambitious contributor
26Feb2008,17:10   #3
elec.shabnam's Avatar
sir macros receive values in compile time,so in run time we cannot change,is it right.