MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / main

Function main

base_code/struct_function.cpp:58–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56//void B() {} //error! 符号 "B" 已经被定义为一个 "struct Base1" 的别名
57
58int main() {
59// Base base{}; // error
60 struct Base base{};
61 base.v1=1;
62// base.v3=2; // error
63 Base::print();
64 printf("%d\n",base.v1);
65// printf("%d\n",base.v3); // error
66 Base *b = new Derived();
67 b->print(); // todo:Base::print() 和 class 有点不一样
68 delete b;
69 return 0;
70}

Callers

nothing calls this directly

Calls 1

printMethod · 0.45

Tested by

no test coverage detected