使外(c++)在-betterC中有效地址
外(c++)在-betterC中有效
struct Base { int x; void g(){ import core.stdc.stdio; printf("%d",x); } } struct Derived {//有一个来实现继承 Base _base; alias _base this; } void foo(Base b) { b.g(); } extern(C)void main(){//Symbol Undefined __d_run_main //没有extern(C)就会出现上面的问题 Derived d; d.x = 42; foo(d); }
地址在此