Retrieve the field names associated with a structure
String_Type[] = get_struct_field_names (Struct_Type s)
The get_struct_field_names function returns an array of
strings whose elements specify the names of the fields of the
struct s.
The following example illustrates how the
get_struct_field_names function may be used to print the
value of a structure.
define print_struct (s)
{
variable name, value;
foreach (get_struct_field_names (s))
{
name = ();
value = get_struct_field (s, name);
vmessage ("s.%s = %s\n", name, string (value));
}
}
|