RosettaCodeData/Task/Null-object/C++/null-object-3.cpp

10 lines
101 B
C++
Raw Permalink Normal View History

2014-04-02 16:56:35 +00:00
int *p = nullptr;
...
2015-02-20 00:35:01 -05:00
if (p == nullptr){
// do some thing
}
//or just
if (p){
2014-04-02 16:56:35 +00:00
// do some thing
}