Esempio libreria eseguibile

From vsd
Revision as of 13:32, 16 April 2019 by Renzo (talk | contribs) (Created page with "FIle library.c: <source lang=c> // library.c #include <stdio.h> #include <stdlib.h> void foo(int x) { printf("foo(%d)\n", x); } int main(int argc, char **argv) { if...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

FIle library.c:

// library.c
#include <stdio.h>
#include <stdlib.h>

void foo(int x) {
    printf("foo(%d)\n", x);
}

int main(int argc, char **argv) {
    if (argc != 2) {
        fprintf(stderr, "USAGE: %s n\n", argv[0]);
        exit(1);
    }
    foo(atoi(argv[1]));
    return 0;
}


Credits: