struct node{ int data; struct node * next; };
How the compiler allocates memory for the "next" member when we have not allocated memory for the "struct node" structure yet
nextmember is a pointer - a variable that will contain the address node, not node. All data type pointers are usually the same size, so it is enough for the compiler to know that it is a pointer that can calculate its size.
next
node
The next element is a pointer. Pointers are the same size, so the compiler does not need to know how big a thing the next may refer to.
- , , + int + padding node struct
, malloc. . 4 , "" . , ( )
Source: https://habr.com/ru/post/1715514/More articles:Can I impersonate app.config for a console application? - c #File Comparison Tool with Combined File Viewer - diffПростая функция JavaScript с немедленным вызовом не работает... почему? - javascriptWhat is the best way or tool to show how long a command line operation takes? - command-lineCan I turn off Hudson's automatic scheduled builds all at once? - javaUIButtons do not respond to touch after a given frame during autorotation - iphoneРазница между кодом, сгенерированным с использованием функции шаблона и нормальной функцией - c++How to install AeDebug to get minidump with process name? - debuggingHow can I decide if the application is suitable for SharePoint? - sharepointWhat exactly does this Google Adense code do? - javascriptAll Articles