Implement perror() #6

Merged
apio merged 2 commits from perror into main 2022-10-08 10:46:02 +00:00
Showing only changes of commit e76d903642 - Show all commits

View File

@ -15,6 +15,6 @@ int main()
printf("Allocating 4 MB of memory... %lx\n", (unsigned long)allocated);
sleep(1);
} while ((allocated = malloc(CHUNK)));
printf("Out of memory. (errno=%d, %s)\n", errno, strerror(errno));
perror("malloc");
printf("Press any key to restart.\n");
}