가능한 중복 : 예
How are objects stored in memory in C++?C++에서 클래스의 메모리가 어떻게 처리됩니까?
은 C++ 클래스 :
class A{ int value; void addOne(){ value++; } }
클래스 A의 인스턴스는이 [의사 코드]과 같이 로딩 될 것이다 :
[identifier of A] [this is int value] [this is void addOne(void)][value++]또는 다음과 같이하십시오 :
[members identifier of A] [this is int value]둘째로 적은 메모리를 사용해야합니다. 한 클래스의 여러 인스턴스에서. 동일한 함수가 모든 인스턴스에 사용되기 때문입니다. C++에서 메모리를 어떻게 처리합니까? 메모리 처리를 변경할 수 있습니까?[functions identifier of A] [this is void addOne(ref to member of A)][A.value++]
"A의 식별자"란 무엇입니까? 또는 "A의 회원 식별자"? –
죄송합니다. 적절한 복제본이 아닙니다. – GWW
이 질문에 대한 답변이 있습니까? http://stackoverflow.com/questions/2006504/c-data-alignment-member-order-inheritance/2007980#2007980 – Beanz