Loop properties in struct-C

Is it possible to use forloop to get the "struct" property names in C? Or would I just make a separate list? (Just the name I'm looking for)

+3
source share
2 answers

You will need to make a separate list. The C programming language does not have the ability to introspect to list the names of structure properties.

+3
source
Cycles

forunable to list members structin C, no. In fact, after compilation, the C program has no concept of member names at all, it just uses the offsets from the struct pointer.

0
source

Source: https://habr.com/ru/post/1750918/


All Articles