Is there a way to go through a struct changing each value without writing it out manually, eg not doing:
myStruct.a = 5;
myStruct.b = 7;
myStruct.c = 9;
I have a struct containing 17 ints, I then read in the data from a file all at once. I then want to go through each int and convert it to little endian. I figured there's gotta be an easier way than converting all the values one by one.
I'm using C++
myStruct.a = 5;
myStruct.b = 7;
myStruct.c = 9;
I have a struct containing 17 ints, I then read in the data from a file all at once. I then want to go through each int and convert it to little endian. I figured there's gotta be an easier way than converting all the values one by one.
I'm using C++
Comment