subroutine_direct.c and subroutine_indirect.c
23 lignes
#include <stdio.h>
#include <stdio.h>
typedef int (*func_t)(void);
typedef int (*func_t)(void);
int subroutine(){
int subroutine(){
    printf("  I am the subroutine\n");
    printf("  I am the subroutine\n");
    return 0;
    return 0;
}
}
int main(int argc, char *argv[])
int main(int argc, char *argv[])
{
{
    printf("--> Start %s\n", argv[0]);
    printf("--> Start %s\n", argv[0]);
    // Direct call
    // Direct call
    subroutine();
    //subroutine();
    // Indirect call
    // Indirect call
    //func_t f_sub = &subroutine;
    func_t f_sub = &subroutine;
    //f_sub();
    f_sub();
    return 0;
    return 0;
}
}