srdusr
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2023-06-26 16:11:03 +0200
committersrdusr <[email protected]>2023-06-26 16:11:03 +0200
commit7091a74b9ee3d530659c5ce0ba24b1d96518a43f (patch)
treef6df0acb089ce488facf3cfcee3ac1b9163588d4
parent63523b2d00c706b42202bc9611bdd190df1a3800 (diff)
downloadnotes-7091a74b9ee3d530659c5ce0ba24b1d96518a43f.tar.gz
notes-7091a74b9ee3d530659c5ce0ba24b1d96518a43f.zip
Add Memory Allocation
-rw-r--r--languages/c.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/languages/c.md b/languages/c.md
index 58a309e..e80652b 100644
--- a/languages/c.md
+++ b/languages/c.md
@@ -182,3 +182,10 @@ int value = *pointerName;`
- scanf("%d", &<variable>); // Reads input from the user
- - -
+
+##### Memory Allocation:
+- malloc(size); // Allocates a block of memory
+- calloc(n, size); // Allocates an array of n elements, initialized to zero
+- free(pointer); // Deallocates the memory block
+
+- - -