This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Design question about global variable

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

Parents
  • Why not check out my blog at http://www.kneeltronicals.com ? There's an entry about mules and their traits.
    because I love Google
    Google will get me to the informatin I am looking for and I do not have to wade through tons of blabber.
    nothing personal, I do not read blogs, I do not have facebook, I do not have twitter.

    if you want to dissiminate information put it where it goes do no make references to az place to search for it. If Instead of "Why not check out my blog" you could put up a link to the EXACT place where the relevant info was I would gladly look at it, but asking me to wade through a bunch of useless information will not work.

    Erik

Reply
  • Why not check out my blog at http://www.kneeltronicals.com ? There's an entry about mules and their traits.
    because I love Google
    Google will get me to the informatin I am looking for and I do not have to wade through tons of blabber.
    nothing personal, I do not read blogs, I do not have facebook, I do not have twitter.

    if you want to dissiminate information put it where it goes do no make references to az place to search for it. If Instead of "Why not check out my blog" you could put up a link to the EXACT place where the relevant info was I would gladly look at it, but asking me to wade through a bunch of useless information will not work.

    Erik

Children