C

Asked • 04/12/19

What is the difference between NULL, '\\0' and 0?

In C, there appear to be differences between various values of zero -- `NULL`, `NUL` and `0`.I know that the ASCII character `'0'` evaluates to `48` or `0x30`.The `NULL` pointer is usually defined as: #define NULL 0Or #define NULL (void *)0In addition, there is the `NUL` character `'\\0'` which seems to evaluate to `0` as well.Are there times when these three values can not be equal?Is this also true on 64 bit systems?

1 Expert Answer

By:

Tyler P. answered • 04/12/19

Tutor
4.9 (110)

Software Engineering Graduate That Is Happy to Help

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.