静态函数只在所定义的.c文件域中有效。
例子:
// d.h
#ifndef D_H
#define D_H

static void test();
void test1();
#endif

//dp.c
#include <iostream.h>
#include “d.h“

void test()


{
cout<<“hi“<<endl;
}

void test1()


{
test();
}

//mainp.c
#include <iostream>
#include “d.h“
using namespace std;

void main()

{
test1();
}

这例子是能顺利编译通过。因为test1()在所在的.c中能看到test()的定义,因而能调用之。但没有了
#ifndef D_H
#define D_H
#include <iostream.h>
static void test()
{
cout<<“HI“<<endl;
}

#endif
这样,包含这个.h就能直接调用test()。