subroutine_direct.c and subroutine_indirect.c
3 removals
Words removed | 3 |
Total words | 40 |
Words removed (%) | 7.50 |
23 lines
3 additions
Words added | 3 |
Total words | 40 |
Words added (%) | 7.50 |
23 lines
#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;
}
}