《C++代码分析》第三回:类成员函数覆盖&&父类函数的调用(分析this指针的变化)

一、前言

在C++的学习中我们知道,子类是可以覆盖父类的方法,这里我们探讨一下子类方法调用父类方法时this指针时如何变化的。

二、示例代码

#include "windows.h"
#include "windef.h"
#include 
#include 
using namespace std;

class People {
   
protected:
	int gender;
	float stature;
	float weight;
public:
	void GetInfo() {
   
		printf("%d--%f--%f\n",

你可能感兴趣的:(C++代码分析专题,c++,开发语言)