when to use below type of macro ?
-
I want to know when to use below type of macro ? i want to understand this macro also.
what is application of it ?
#define NULL_PTR ((void *) 0L)
-
@Qt-embedded-developer said:
I want to know when to use below type of macro ?
Almost never. It's obsolete. Maybe if you're writing some retro-code for an ancient compiler as a hobby, but that's it. Not in any modern code.
i want to understand this macro also.
It creates a pointer to void with a value of 0. C++11 introduced nullptr to do the same without hacking the type system.
what is application of it ?
Currently none. It's obsolete. It was used to have a pointer type with a value of 0. Now you have nullptr.
-
This is no longer needed since all compilers supported by Qt support c++11 and therefore the 'nullptr' keyword. I'm pretty sure it's no longer available in Qt6.
-
@Christian-Ehrlicher dear this doesn't matter can you tell me what i mentioned in post?
-
@Qt-embedded-developer said:
I want to know when to use below type of macro ?
Almost never. It's obsolete. Maybe if you're writing some retro-code for an ancient compiler as a hobby, but that's it. Not in any modern code.
i want to understand this macro also.
It creates a pointer to void with a value of 0. C++11 introduced nullptr to do the same without hacking the type system.
what is application of it ?
Currently none. It's obsolete. It was used to have a pointer type with a value of 0. Now you have nullptr.
-
@Qt-embedded-developer said in when to use below type of macro ?:
#define NULL_PTR ((void *) 0L)
In C, the macro NULL may have the type void*, but that is not allowed in C++.
-