in g ++, NULL is defined as __null, in the 64-bit case, __null is 8 bytes. eg:
printf("sizeof(__null):%d, sizeof(0):%d\n", sizeof(__null), sizeof(0)); sizeof(__null):8, sizeof(0):4
however, where is __null defined?
The __null implementation is internal g ++. You will not find it in the header file or anything like that. You can find some explanation of the logic here , but the basic idea is that this is the easiest way to ensure that NULL is treated as a pointer in the first place.
__null
Basically, the inside does what reinterpret_cast<void *>(0) would naively expect.
reinterpret_cast<void *>(0)
Source: https://habr.com/ru/post/1389984/More articles:How can I send a shared file to the jersey service and receive it correctly? - javaHow to avoid memory exception when using PLINQ? - c #Where can I find the Chinese handwriting recognition engine for Android / IPhone? - androidDoes the dispatch_sync (dispatch_get_global_queue ()) call in the main thread cause the application to hang? - iosExtending linq to sharepoint to publish HTML fields - c #Automatic and general mapping - automapperAndroid - add the next and prev button to the on-screen keyboard that appears when you click on an edited text in my activity - androidIn C, what does “do?” - cHow to use the Switch enclosure in Java - javavs .list array performance issue - c #All Articles