#include <stdio.h>
#include <stdint.h>
union Data {
uint8_t index; // 1 byte
float resource; // 4 bytes
};
int main() {
union Data data;
data.index = 1;
printf("Index: %d\n", data.index);
data.resource = 5.0;
printf("Resource: %f\n", data.resource);
printf("Index: %d\n", data.index);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRpbnQuaD4KCnVuaW9uIERhdGEgewogICAgdWludDhfdCBpbmRleDsgICAgICAgLy8gMSBieXRlCiAgICBmbG9hdCByZXNvdXJjZTsgICAgICAvLyA0IGJ5dGVzCn07CgppbnQgbWFpbigpIHsKICAgIHVuaW9uIERhdGEgZGF0YTsKCiAgICBkYXRhLmluZGV4ID0gMTsKICAgIHByaW50ZigiSW5kZXg6ICVkXG4iLCBkYXRhLmluZGV4KTsKCiAgICBkYXRhLnJlc291cmNlID0gNS4wOwogICAgcHJpbnRmKCJSZXNvdXJjZTogJWZcbiIsIGRhdGEucmVzb3VyY2UpOwpwcmludGYoIkluZGV4OiAlZFxuIiwgZGF0YS5pbmRleCk7CiAgICByZXR1cm4gMDsKfQo=
MTAKYWJhCmdlZWtzZm9yZ2Vla3MKZ2Vla3Nmb3JnZWVrcwpnZWVrc2ZvcmdlZWtzCmdlZWtzZm9yZ2Vla3MKZ2Vla3Nmb3JnZWVrcwpnZWVrc2ZvcmdlZWtzCmdlZWtzZm9yZ2Vla3MKZ2Vla3Nmb3JnZWVrcwpnZWVrc2ZvcmdlZWtz
10
aba
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks