Sample Multi-File Program
/*****************************************************
File: header.h
This file contains variable and function declarations
******************************************************/
#ifndef HEADER
#define HEADER
extern int k;
void print_it();
#endif
/*****************************************************
End of header file
*****************************************************/
/********************************************************
File: implementation.C
This file contains the definition of a function declared
in header.h
*********************************************************/
#include "header.h"
#include <iostream.h>
void print_it()
{
cout << "The value passed is: " << k << endl;
}
/********************************************************
End of implementation file
********************************************************/
/********************************************************
File: main.C
This is the client function file
********************************************************/
#include "header.h"
int k = 100;
int main()
{
print_it();
return(0);
}
/********************************************************
End of main.C
********************************************************/
Back to Previous Page
Document:
Local Date:
Last Modified On: