MCPcopy Create free account
hub / github.com/changkun/modern-cpp-tutorial / main

Function main

code/2/2.1.cpp:14–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12void foo(int);
13
14int main() {
15
16 if(NULL == (void *)0)
17 std::cout << "NULL == 0" << std::endl; // 该行将输出
18 else
19 std::cout << "NULL != 0" << std::endl;
20
21 foo(0); // 调用 foo(int)
22 //foo(NULL); // 该行不能通过编译
23 foo(nullptr); // 调用 foo(char*)
24
25 return 0;
26}
27void foo(char *ch) {
28 std::cout << "call foo(char*)" << std::endl;
29}

Callers

nothing calls this directly

Calls 1

fooFunction · 0.70

Tested by

no test coverage detected