Home > Back-end >  C memory partition
C memory partition

Time:10-05

Review the C language a few days ago when he found himself for memory partition has some misunderstanding, sums up and, as follows, if there are any mistakes still hope correct

CodePudding user response:

You organize a little flaw, but didn't also way, after all, different compilers and operating systems for the arrangement of data in the memory is not too same, these things, you have a concept is ok, if you want to learn the computer composition principle more underlying again understanding, such as in C, you just need to know all kinds of object life cycle is enough to solve many problems,

Note: inaccurate place:
1. Const object is not necessarily in the static storage area, such as local const objects can be automatic storage area,
2. Common literal is not necessarily don't account for memory, for example, the compiler may put a double literal exist, static storage areas, with direct access to the corresponding memory, then the code instead of the data and instructions bundled together, not to mention there is the existence of the compound literal,

CodePudding user response:

reference 1st floor apkipa1 response:
you organize a little flaws, but didn't also way, after all, different compilers and operating systems for the arrangement of data in the memory is not too same, these things, you have a concept is ok, if you want to learn the computer composition principle more underlying again understanding, such as in C, you just need to know all kinds of object life cycle is enough to solve many problems,

Note: inaccurate place:
1. Const object is not necessarily in the static storage area, such as local const objects can be automatic storage area,
2. Common literal is not necessarily don't account for memory, for example, the compiler may put a double literal exist, static storage areas, with direct access to the corresponding memory, then the code is tied instead of data and instructions, let alone have the existence of the compound literal,

Thank you, now learned c, is read c + + primer, learned after will consider computer composition principle
  • Related