You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
函数指针
函数是存放在内存的代码区域内
栗子
使用typedef
函数指针作为参数传递给函数
指向函数的指针数组
指向类成员函数的函数指针
由于虚函数是偏移量,所以取得的只是一个索引,即在虚函数表的偏移地址
非虚函数,返回的是在内存中的真实地址
普通函数指针保存的是函数体开始的地址,即,代码指针。
由于虚函数的存在,所以在在类的成员函数指针在调用的时候需要传入类的实例化后的对象,用于找到虚函数在内存中的函数体开始的地址。
The text was updated successfully, but these errors were encountered: