#include <stdio.h>
struct Data {
int a[5];
};
void array(struct Data *data);
int main(void) {
struct Data data = {0, 1, 2, 3, 4};
array(&data); // Use & to pass the address of 'data'
for (int i = 0; i < 5; i++) {
}
return 0;
}
void array(struct Data *data) {
data->a[1] += 1; // Use '->' to access the array within the struct
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3QgRGF0YSB7CiAgICBpbnQgYVs1XTsKfTsKCnZvaWQgYXJyYXkoc3RydWN0IERhdGEgKmRhdGEpOwoKaW50IG1haW4odm9pZCkgewogICAgc3RydWN0IERhdGEgZGF0YSA9IHswLCAxLCAyLCAzLCA0fTsKICAgIGFycmF5KCZkYXRhKTsgIC8vIFVzZSAmIHRvIHBhc3MgdGhlIGFkZHJlc3Mgb2YgJ2RhdGEnCiAgICAKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgNTsgaSsrKSB7CiAgICAgICAgcHJpbnRmKCIlZCAiLCBkYXRhLmFbaV0pOwogICAgfQogICAgcmV0dXJuIDA7Cn0KCnZvaWQgYXJyYXkoc3RydWN0IERhdGEgKmRhdGEpIHsKICAgIGRhdGEtPmFbMV0gKz0gMTsgIC8vIFVzZSAnLT4nIHRvIGFjY2VzcyB0aGUgYXJyYXkgd2l0aGluIHRoZSBzdHJ1Y3QKfQo=