Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Definition of NULL
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jason Curl, post: 2394055"] From what I gather reading the C FAQ is the best way is to typecast NULL to (char*) as it could be such a machine where an (int*) has a different representation to (char*). The compiler wouldn't know what to cast a (void*) to. I guess it works because on most machines (void*) has the same representation internally as (int*) and (char*). It appears from everything I've read so far that just using NULL is not portable, as it was my original intention of a slight optimisation of using calloc instead of malloc and setting the pointers to NULL explicitly. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Definition of NULL
Top