659
edits
Carandraug (talk | contribs) (→Structures: use a less morbid example) |
Carandraug (talk | contribs) m (→Problem: typo) |
||
Line 4: | Line 4: | ||
=== Retrieve a field value from all entries in a struct array === | === Retrieve a field value from all entries in a struct array === | ||
==== Problem ==== | ==== Problem ==== | ||
You have a struct array with multiple fields, and you want to acess the value from a specific field from all elements. For example, you want to return the age from all | You have a struct array with multiple fields, and you want to acess the value from a specific field from all elements. For example, you want to return the age from all patients in the following case: | ||
samples = struct ("patient", {"Bob", "Kevin", "Bob" , "Andrew"}, | samples = struct ("patient", {"Bob", "Kevin", "Bob" , "Andrew"}, |