假设我们有一个程序由5个文件组成,源代码如下:
/*
main.c
*/
#include " mytool1.h "
#include " mytool2.h "
int main()
{
mytool1_print( " hello mytool1! " );
mytool2_print( " hello mytool2! " );
return 0 ;
}
#include " mytool1.h "
#include " mytool2.h "
int main()
{
mytool1_print( " hello mytool1! " );
mytool2_print( " hello mytool2! " );
return 0 ;
}
/*
mytool1.c
*/
#include " mytool1.h "
#include < stdio.h >
void mytool1_print( char * print_str)
{
printf( " This is mytool1 print : %s " ,print_str);
}
#include " mytool1.h "
#include < stdio.h >
void mytool1_print( char * print_str)
{
printf( " This is mytool1 print : %s " ,print_str);
}
/*
mytool1.h
*/
#ifndef _MYTOOL_1_H
#define _MYTOOL_1_H
void mytool1_print( char * print_str);
#endif
#ifndef _MYTOOL_1_H
#define _MYTOOL_1_H
void mytool1_print( char * print_str);
#endif
/*
mytool2.c
*/