#include #include main() { size_t n; char *p; for (;;) { printf("How many bytes should I allocate?\n"); scanf("%u", &n); p = malloc(n); if (p == NULL) { printf("Can't allocate %u bytes.\n", n); } else { printf("%u bytes were available. Try for more.\n", n); system("ps -o vsz,comm | awk 'NR == 1 || $2 == \"a.out\"'"); free(p); } } }