Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats the difference between… > NULL, 0, and nul?

difference nul null
0
Posted

Whats the difference between… > NULL, 0, and nul?

0

NULL is a macro defined in several standard headers, 0 is an integer constant, ‘\0’ is a character constant, and nul is the name of the character constant. All of these are *not* interchangeable: NULL is to be used for pointers only since it may be defined as ((void *)0), this would cause problems with anything but pointers. 0 can be used anywhere, it is the generic symbol for each type’s zero value and the compiler will sort things out. ‘\0’ should be used only in a character context.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123