I am interested in printing the structure fields .
Typedef struct
{
UINT32 thread_id;
BOOL is_valid;
}T_THREAD;
Is there a way in "C" language to print the contents of a structure, something like
ex: print (T_THREAD)
and output should be like
Contents of a structure T_THREAD are
thread_id
is_valid
What you're looking for is reflection. Java and other virtual languages has reflection so you can print out the variable names and function names for any given class. Because the compiler builds these reflection functions automatically.
C does not have reflection. You must do everything manually.