This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:fall2024:projects:msi1 [2024/09/19 01:17] – [malloc] cburling | notes:fall2024:projects:msi1 [2024/09/19 03:39] (current) – [malloc] bpatrice | ||
---|---|---|---|
Line 9: | Line 9: | ||
</ | </ | ||
Congratulations you now have a Node! You might also find it useful to have a List so List struct and malloc that in the same manner. | Congratulations you now have a Node! You might also find it useful to have a List so List struct and malloc that in the same manner. | ||
+ | |||
+ | Also, remember that whenever you allocate memory(malloc) you are also responsible for freeing that memory at the end of your program. | ||
+ | You can do this by using | ||
+ | < | ||
+ | free(Node); | ||
+ | </ | ||
=====pointer arithmetic===== | =====pointer arithmetic===== |