I need something that will work with the following:
struct thing *s;
printf("the size of %s is %d", s->type, (int) sizeof(s->type));
I thought I had at last found a solution with typedef
, but no:
struct thing {
typedef int type;
}
expects syntax of the form thing::type
. I suspect the solution still involves typedef, but I need the type to actually be a member, as opposed to a nested type.
Edit: Whoops, looks like the functionality I needed was just a string after all. Sorry, thanks for helping!