Created
April 24, 2011 08:38
-
-
Save michaelbartnett/939407 to your computer and use it in GitHub Desktop.
Clockwise spiral for malloc lab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-------------------+ | |
| +----------+ | | |
| | +-+ | | | |
| ^ ^ | | | | |
*(size_t *)p = size;| | | |
^ ^ ^ | | | | |
| | +---+ | | | |
| +-----------------+ | | |
+---------------------+ | |
Each item in this list points to the spiral's intersection with the code starting from 'p'. | |
1. p -> The variable p | |
2. * -> is a pointer to a value | |
3. size_t -> of type size_t. | |
4. * -> Indirection operator. Indicates that although we've gone through all this trouble to make p a (size_t *), that we actually want to look at the memory address pointed to by p. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment