Created
October 5, 2016 16:00
-
-
Save AndyNovo/2e30f1147c68cae4bbcf921b6c176aa7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char **argv) { | |
size_t bytes = 1; | |
int* p2chunk = (int *) malloc(bytes); | |
printf("%p p2chunk\n", (void*)p2chunk); | |
p2chunk[0] = 1; | |
p2chunk[1] = 2; | |
p2chunk[2] = 3; | |
p2chunk[3] = 4; | |
printf("%d %d %d %d\n", p2chunk[0], p2chunk[1], p2chunk[2], p2chunk[3]); | |
free(p2chunk); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment