I have come across the void functions in c. And I understood that these functions wont return any value but will be having a return statement. I have tried to see the size of the function with the sizeof operator. The value is printed was 1 as size of void function. Can anyone explain how the 1 is the size of the function??
The below is the program i have used.
#include <stdio.h>
void my_func()
{
printf("From void my_function\n");
return ;
}
int func()
{
printf("From int func\n");
return 0;
}
int main()
{
printf("Size of void function : %lu\n",sizeof(my_func())); // 1 is printed
printf("Size of integer function : %lu\n",sizeof(func())); // 4 is printed
return 0;
}