Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ triple equals?

Tags:

c++

I need to be able to differentiate between NULL and 0 in c++.

Is there a way to use something like the === operator (such as the identity operator found in JavaScript) to tell the difference between NULL and 0 in c++?

like image 690
user2325753 Avatar asked Sep 10 '25 14:09

user2325753


1 Answers

NULL is a preprocessor macro, and will be replaced directly with 0 when the preprocessor runs. So in short, no.

like image 113
RandyGaul Avatar answered Sep 12 '25 05:09

RandyGaul



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!