home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
- From: twbrown@PE-Nelson.COM (Tom W. Brown)
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Style wars with NULL (was Re: How to remove kbd message from system queue?)
- Message-ID: <752@lax.lax.pe-nelson.com>
- Date: 21 Jan 93 18:37:34 GMT
- References: <1ja2l6INNla3@msuinfo.cl.msu.edu> <1993Jan19.135956.22950@ugle.unit.no> <1993Jan20.211104.8721@emr1.emr.ca>
- Sender: news@lax.pe-nelson.com
- Organization: PE-Nelson
- Lines: 22
-
- In article <1993Jan20.211104.8721@emr1.emr.ca>, jagrant@emr1.emr.ca (John Grant) writes:
- |> Technically speaking, NULL is used for a pointer, whereas
- |> 0 or 0L are int values. The CALLBACK function requires an
- |> LRESULT (long int), which is a 0 or 0L, but not a NULL.
-
- Well, technically speaking NULL is defined as 0 (or should be) so there is
- nothing wrong with using it (no matter whether the function returns an int,
- a long, or a pointer).
-
- However stylistically I agree with John. I use NULL for pointers and
- handles and an explicit zero for explicit numeric types. Likewise I try
- to use TRUE and FALSE only for BOOL return types.
-
- Let the style war begin! :-0
-
-
- ----------------------------------------------------------------------------
- Tom Brown | "She turned me into a newt...
- PE Nelson Systems | ... I got better"
- twbrown@pe-nelson.com | Monty Python and the Holy Grail
- ----------------------------------------------------------------------------
-
-