Hello
Normall in an application we define global variable as: int a; int b; ...
How about use one structure to include all variables, and just define one structure instance? as below: struct{ int a; int b; ... }global;
Is the performance slower? does it take more code space? Is there any other drawback?
Thanks.
/Wang
this reduces performance, and, requires that every pointer that addressed that data is also packed. Still sounds like a good idea?
Yes, it does, for applications where extreme speed or code density is not very important. That would be a majority of applications, by the way.
@Mike Kleshov,
Well in my opinion, this is a very unwise approach. But this is merely my opinion.