Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/EricPengShuai/Interview
/ main
Function
main
base_code/default_arg.cpp:24–31 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
22
};
23
24
int main()
25
{
26
Derived d;
27
Base *bp = &d;
28
// 默认参数是静态绑定的,虚函数是动态绑定的。 默认参数的使用需要看指针或者引用本身的类型,而不是对象的类型。
29
bp->fun(); // Derived::fun(), x = 10
30
return 0;
31
}
Callers
nothing calls this directly
Calls
1
fun
Method · 0.45
Tested by
no test coverage detected