![]() It means that the following is also perfectly legal as per standard: But, C standard is saying that 0 is also a null pointer constant. Though the actual C11 standard can be purchased from ISO, there’s a draft document which is available in public domains for free.Ĭoming back to our discussion, the NULL macro is defined as ((void *)0) in the header files of most of the C compiler implementations. Greenfoot null pointer exception iso#For completeness, let us mention that the previous C standards were C99, C90 (also known as ISO C) and C89 (also known as ANSI C). Please note that ISO/IEC 9899:2011 is the C language’s latest standard which was published in Dec 2011. If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed to compare unequal to a pointer to any object or function.”īefore we proceed further on this NULL discussion :), let’s mention a few lines about C standard just in case you want to refer to it for further study. ![]() “ An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant. Let us see what C standards say about the null pointer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |