You are not logged in.
Hi guys, i'm writing a software in C and i have to create a sort of 'macro' that compiles a list of global variables decleared.
Example:
MACROLIST unsigned short a;
MACROLIST unsigned long b;
MACROLIST char c[12];
What i have in mind is using a macro before every variable declaration, in order to insert every variable in a virtual list.
My target is:
int i;
for(i=0;i<num_variables;i++)
{
printf("%ld",&var[i]);
}
How could i get this?
Offline
I don't think that's possible.
You may be able to do that in C99 for local variables (in a function), though...
May I ask what your goal is?
Offline
I've got a source code for an embeeded application (PowerPC) without operating system.
Now i'm porting in it on Qt on linux on a ARM and i want to save the contents of all the variables in a file.
Offline