subroutine_direct.c and subroutine_indirect.c

Created Diff never expires
3 Entfernungen
Zeilen
Gesamt
Entfernt
Wörter
Gesamt
Entfernt
Um diese Funktion weiterhin zu nutzen, aktualisieren Sie auf
Diffchecker logo
Diffchecker Pro
23 Zeilen
3 Hinzufügungen
Zeilen
Gesamt
Hinzugefügt
Wörter
Gesamt
Hinzugefügt
Um diese Funktion weiterhin zu nutzen, aktualisieren Sie auf
Diffchecker logo
Diffchecker Pro
23 Zeilen
#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;
}
}