top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Any way to output variable names with their size (i.e. int, char etc.) in a C?

+4 votes
100 views

I am wanting to extract variable names and their size (int, char and etc.) from a c file.
Is there any way to extract that type of information?

posted Jan 10, 2014 by Meenal Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Those are types, not sizes. A variable's type is a property of the source code, the size of that type depends on the compiler and target platform.

You could compile it and look at the debug info. Or write a GCC plugin to output the info as the file is compiled.

answer Jan 10, 2014 by Satish Mishra
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...