Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
In short, NULL is the 0 value, and a null pointer is a pointer variable that points to nothing. some systems allowing a different representation of the null pointer other than zero Years back...
Answer
#2: Post edited
In short, NULL is the 0 value, and a null pointer (void *) is a pointer variable that points to nothing.- > some systems allowing a different representation of the null pointer other than zero
- Years back compilers implemented some things on their own, partly because the language standards weren't strictly defined and imposed. For instance, I remember using a compiler that handled ```random``` related implementations in a different manner than other compilers. So, while some compilers defined their own null pointer implementation, NULL was always 0.
- > Can NULL be something other than zero?
- No, I don't think so. However, you can tweak a compiler to replace instances of NULL with a value other than 0, but that wouldn't be a standard C compiler then.
- In short, NULL is the 0 value, and a null pointer is a pointer variable that points to nothing.
- > some systems allowing a different representation of the null pointer other than zero
- Years back compilers implemented some things on their own, partly because the language standards weren't strictly defined and imposed. For instance, I remember using a compiler that handled ```random``` related implementations in a different manner than other compilers. So, while some compilers defined their own null pointer implementation, NULL was always 0.
- > Can NULL be something other than zero?
- No, I don't think so. However, you can tweak a compiler to replace instances of NULL with a value other than 0, but that wouldn't be a standard C compiler then.
#1: Initial revision
In short, NULL is the 0 value, and a null pointer (void *) is a pointer variable that points to nothing. > some systems allowing a different representation of the null pointer other than zero Years back compilers implemented some things on their own, partly because the language standards weren't strictly defined and imposed. For instance, I remember using a compiler that handled ```random``` related implementations in a different manner than other compilers. So, while some compilers defined their own null pointer implementation, NULL was always 0. > Can NULL be something other than zero? No, I don't think so. However, you can tweak a compiler to replace instances of NULL with a value other than 0, but that wouldn't be a standard C compiler then.