473,626 Members | 3,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: (part 3) Han from China answers your C questions

On October 29, 2008 19:30, in comp.lang.c, Nomen Nescio (no****@dizum.c om)
wrote:
what is the difference between NULL and 0

Richard Heathfield said:
iceman19860106 said:
>>>
hello everyone!
what is the difference between NULL and 0 in C language?

NULL is a macro defined in <stdio.h>

Hello, iceman! How are you, buddy?

Despite what Dick Heathfield said, it's slightly more accurate to say
that NULL is a macro defined in <stddef.h>. This is nitpick central,
after all.
Well, you said it: "This is nitpick central". I have a nit to pick.

According to the C99 standard, the macro NULL is defined in
a) <stddef.h>, /and/
b) <stdio.h>, /and/
c) <stdlib.h>

[snip]

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
Oct 29 '08 #1
1 1317
Lew Pitcher wrote:
On October 29, 2008 19:30, in comp.lang.c, Nomen Nescio (no****@dizum.c om)
wrote:
>what is the difference between NULL and 0

Richard Heathfield said:
iceman198601 06 said:
>>>hello everyone!
what is the difference between NULL and 0 in C language?
NULL is a macro defined in <stdio.h>
Hello, iceman! How are you, buddy?

Despite what Dick Heathfield said, it's slightly more accurate to say
that NULL is a macro defined in <stddef.h>. This is nitpick central,
after all.

Well, you said it: "This is nitpick central". I have a nit to pick.

According to the C99 standard, the macro NULL is defined in
a) <stddef.h>, /and/
b) <stdio.h>, /and/
c) <stdlib.h>
also in:

<locale.h>
<string.h>
<time.h>
<wchar.h>

--
pete
Oct 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1947
by: Nomen Nescio | last post by:
A new learner's question Flash Gordon wrote: To the OP, please be aware that Flash Gordon has a history of either deliberately misleading and "miss-informing" posters to this newsgroup or providing facile answers with which to amuse himself. In this case, both. Facile because Flash Gordon did not tell you substantially anything more than your compiler had told you. Misleading
0
1471
by: Nomen Nescio | last post by:
what is the type for this call? Neo said: Neo, buddy, I've decided to give you a little summary for reference so that you don't have to sift through excess verbiage, cryptic meanderings, and irrelevant matters of naming to make sense of this thing. Please forgive any typos on my part.
0
1286
by: Nomen Nescio | last post by:
No format string passed to variable argument list function Adam said: Then Adam laters says: Then Adam later says:
2
1494
by: Chris Dollin | last post by:
Joachim Schmitz wrote: I think that remark is an ill-considered and unhelpful generalisation. -- "We dance, and the worlds melt away." - Curved Air, /Metamorphosis/ Hewlett-Packard Limited registered no: registered office: Cain Road, Bracknell, Berks RG12 1HN 690597 England
2
1528
by: Borked Pseudo Mailed | last post by:
float and integers c.lang.myself@gmail.com said I will be making assumptions here about your system that will infuriate the pedants, but I don't care. Given your X-HTTP-UserAgent string, it is highly probable that these assumptions are valid. Whether you have included stdio.h or not, the float argument to printf() is promoted to a double, since even with a prototype
1
1473
by: George Orwell | last post by:
its urgent.pls help me. mona said: mona said: Hey again, mona. Please check the thread "(part 21) Han from China answers your C questions", in which I gave you a program with
0
1364
by: George Orwell | last post by:
fread breaks file descriptors opened in "w" mode. ... Yes, once you break out of ANSI/ISO C, all things are possible. You have posted an on-topic question to comp.lang.c. See version 2.0 of my topicality FAQ if anyone should tell you otherwise. Search: "Han from China's comp.lang.c topicality FAQ (version 2.0)"
16
1796
by: Borked Pseudo Mailed | last post by:
Error handling in C Nick Keighley said: ... ... To the OP, please be aware that Nick Keighley is a known troll and is deliberately providing you with unsound advice. You asked for error handling, not error generation (or much worse).
2
2193
by: Nomen Nescio | last post by:
What is this? Eric said: That looks like either someone's poor coding or someone's poor pasting for an implementation of offsetof() from stddef.h. The (char *) leads me to think that there's plenty of missing context, so post the surrounding code, and we'll be happy to jerk ourselves off analyzing the code for you and telling you why it won't work on the control system for your Tomahawk missile.
1
1591
by: George Orwell | last post by:
File Seeking / Overwriting bytes Martien Verbruggen said: And this is, of course, also not right. fseek() does support SEEK_END on text streams. If you want to know why, please start a thread on comp.lang.c. Also, you could read "(part 18) Han from China answers your C questions".
0
8266
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8199
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8638
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8365
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.