H*M 发帖数: 1268 | 1 How is the memory layout in an object-oriented language like C++/Java differ
ent from the procedural language like C? In C, we store code and data in var
ious segments like data segments, code segments, stack segments; What do we
do in C++?
Define any class and tell me how will an object of that class be stored in m
emory?
没看出来,难道c的memory layout和c++的不同么?
哪位大虾能给个解释?
谢谢。 | r*********r 发帖数: 3195 | 2 一样的. layout 是 linker 决定的.
java is another story. | s***t 发帖数: 70 | 3 这东西没有标准吧, 甚至cfront不过把c++ translate to C, layout更是一样了.
differ
var
we
m
【在 H*M 的大作中提到】 : How is the memory layout in an object-oriented language like C++/Java differ : ent from the procedural language like C? In C, we store code and data in var : ious segments like data segments, code segments, stack segments; What do we : do in C++? : Define any class and tell me how will an object of that class be stored in m : emory? : 没看出来,难道c的memory layout和c++的不同么? : 哪位大虾能给个解释? : 谢谢。
| m*******a 发帖数: 130 | 4 memory layout一般是系统的概念。按你说的是关于memory region of object file的
东西, c和C++都一样compile成object file,所以都一样.但是汇编码会不一样。 |
|