c-practice/ecode.c

13 lines
253 B
C
Raw Permalink Normal View History

2020-12-06 20:22:45 -06:00
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
if (argc == 2) {
int code = strtol(argv[1], NULL, 0);
return code;
} else {
printf("Requires exactly one argument\n");
return -1;
}
}