Skip to content

Instantly share code, notes, and snippets.

@chelmuth
Created March 10, 2020 12:55
Show Gist options
  • Save chelmuth/953a75201bab1106172f9846ea83d1e7 to your computer and use it in GitHub Desktop.
Save chelmuth/953a75201bab1106172f9846ea83d1e7 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
if (argc < 2) {
printf("usage: errno <num> [num ...]\n");
exit(1);
}
int c;
for (c = 1; c < argc; c++) {
int i = strtol(argv[c], NULL, 0);
printf("errno %d is \"%s\".\n", i, strerror(i));
}
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment