mirror of
https://github.com/Karmaz95/Snake_Apple.git
synced 2026-07-10 19:43:40 +02:00
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
// Allocate memory on the heap
|
||||
char *heapMemory = (char *)malloc(100 * sizeof(char));
|
||||
|
||||
if (heapMemory == NULL) {
|
||||
fprintf(stderr, "Memory allocation failed.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Memory allocated. Press Enter to exit.\n");
|
||||
|
||||
// Wait for Enter key press
|
||||
while (getchar() != '\n');
|
||||
|
||||
// Free allocated memory
|
||||
free(heapMemory);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user