subroutine_direct.c and subroutine_indirect.c

Created Diff never expires
3 हटाए गए
लाइनें
कुल
हटाया गया
शब्द
कुल
हटाया गया
इस सुविधा का उपयोग जारी रखने के लिए, अपग्रेड करें
Diffchecker logo
Diffchecker Pro
23 लाइनें
3 जोड़े गए
लाइनें
कुल
जोड़ा गया
शब्द
कुल
जोड़ा गया
इस सुविधा का उपयोग जारी रखने के लिए, अपग्रेड करें
Diffchecker logo
Diffchecker Pro
23 लाइनें
#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;
}
}