Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CppPeculiarity/cpptask/cpp11/nullptr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <iostream>
void func(void *ptr)
{
std::cout << "func ptr" << std::endl;
}
void func(int i)
{
std::cout << "func i" << std::endl;
}
int main() {
//func(NULL); 编译失败,会产生二义性
func(nullptr); // 输出func ptr
return 0;
}
Binary file added CppPeculiarity/cpptask/cpp11/nullptr.exe
Binary file not shown.