Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver1
973いいね 19,749 views回再生

Become a Malloc() Pro

#dynamicmemoryallocation #malloc In this video, I go over 3 situations where I would use malloc(), calloc(), and realloc(). I also briefly explain the importance of free(). IMPORTANT NOTE In modern C and according to much of the current C Coding standards, malloc() is not casted because the void pointer is automatically promoted to any other pointer type without that cast. This is a required action in C++, therefore I left it in this code for a new learner. However, keep in mind that this practice is looked down on in C due to suppressing compiler diagnostics and readability issues.
00:00 Dynamic Memory Allocation Intro
00:23 Explanation
01:07 malloc()
03:39 calloc()
05:28 realloc()
06:23 Recap/Conclusion

コメント