在一些遗留代码中,我遇到了以下空指针检查。
if( myPtr > 0 ) { ... }
通过此 if 检查检查空指针是否存在任何技术风险?
c++ comparison null null-pointer null-check
c++ ×1
comparison ×1
null ×1
null-check ×1
null-pointer ×1