aboutsummaryrefslogtreecommitdiffstats
path: root/callocing.c
diff options
context:
space:
mode:
Diffstat (limited to 'callocing.c')
-rw-r--r--callocing.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/callocing.c b/callocing.c
new file mode 100644
index 0000000..404b1af
--- /dev/null
+++ b/callocing.c
@@ -0,0 +1,15 @@
+#include<stdio.h>
+#include<stdlib.h>
+
+int main() {
+ int *ptr;
+ ptr = malloc(1024 * 1048576 * sizeof(char));
+// int array[100];
+ int i;
+ for (i = 0; i < 100; i++) {
+ printf("%d: %d\n", i, *(ptr + i));
+ }
+ printf("\n%d\n", ptr);
+ free(ptr);
+ return 0;
+}