Prototypes are useful when compiling when they tell the compiler what a function signature is. However, they are not a means of access control.
, sum() , main(), static. static , .c , .
test() . main() test(), test() sum(), .
file1.c
#include <stdio.h>
static int sum(int a, int b);
void test(void);
int main(void)
{
test();
sum(10, 20);
return 0;
}
static int sum(int x, int y)
{
printf("\nThe Sum is %d", x + y);
}
file2.c
void test(void)
{
sum(1, 2);
}
, #include "File2.c". #include .c , .h. , , .
, . IDE, Visual ++, Windows, , . Linux - :
$ gcc -o test File1.c File2.c
$ ./test