#include <cstdio>
#define NULL1 (void *)0
#define NULL2 0
int main() {
int* p = NULL1; // void* being assigned to a int*, C++ complains.
int* q = NULL2;
return 0;
}
Veni Vedi Slumber !
On Sat, Jul 2, 2011 at 10:28 PM, Decipher <[email protected]> wrote:
> Hey I was asked this question in Broadcom's interview. I thought its worth
> to share it here since its related to null pointer :
>
> What's the dif b/w #define NULL (void*)0 and #define NULL 0 ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/mtyvsP4WoGIJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.