Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Mem alloc test
//gcc 5.4.0 #include <stdio.h> int main(void) { size_t mem_size = 1; printf("Hello, world!\n"); for (int i = 0; i < 1000; i++) { char * p = malloc(mem_size); if (p) { printf("[%3d]:Size = %-20d, Ptr = %p\n", i, mem_size, p); free(p); mem_size *= 2; } else { perror("No memory"); break; } } printf("Goodbye, world!\n"); return 0; }
run
|
edit
|
history
|
help
1
PRACTICA LISTA
Project 3 Part 1 v1.0
PRÁCTICA DE QUICKSORT
Primes in binary
Hello w
sample.c
Rudra
MATRIZ DE CADENAS
B_141202_CONTADORPALABRAS
B_141125_MenorMayor