Object Memory Management
#include <iostream>
using namespace std;
struct Person
{
int m_id;
int m_age;
int m_height;
void display(a) {
cout << "m_id = " << m_id
<< ",m_age = " << m_age
<< ",m_height = "<< m_height << endl; }};int main(a) {
Person person;
person.m_id = 10;
person.m_age = 20;
person.m_height = 30;
Person* p = (Person * )&person.m_age;
p->m_id = 40;
p->m_age = 50;
person.display(a);return 0;
}
Copy the code
May I ask the final print result?