J
John T.
If I have:
struct test{
unsigned short test1;
unsigned short test2;
unsigned short test3;
unsigned char test4;
unsigned char test5;
};
int main(){
test mytest;
mytest.test1 = 0x11FF;
mytest.test2 = 0x22FF;
mytest.test3 = 0x33FF;
mytest.test4 = 0x11;
mytest.test5 = 0xFF;
return 0
}
Then how do I zero all elements of the struct mytest in the easiest possible
way?
The straight-forward way would be:
mytest.test1 = 0x0000;
mytest.test2 = 0x0000;
mytest.test3 = 0x0000;
mytest.test4 = 0x00;
mytest.test5 = 0x00;
But could'nt this be done smarter, or at least, shorter?
John
struct test{
unsigned short test1;
unsigned short test2;
unsigned short test3;
unsigned char test4;
unsigned char test5;
};
int main(){
test mytest;
mytest.test1 = 0x11FF;
mytest.test2 = 0x22FF;
mytest.test3 = 0x33FF;
mytest.test4 = 0x11;
mytest.test5 = 0xFF;
return 0
}
Then how do I zero all elements of the struct mytest in the easiest possible
way?
The straight-forward way would be:
mytest.test1 = 0x0000;
mytest.test2 = 0x0000;
mytest.test3 = 0x0000;
mytest.test4 = 0x00;
mytest.test5 = 0x00;
But could'nt this be done smarter, or at least, shorter?
John