mirror of
https://github.com/Karmaz95/Snake_Apple.git
synced 2026-03-30 14:00:16 +02:00
24 lines
449 B
C
24 lines
449 B
C
#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;
|
|
}
|
|
|