I am using a book entitled "An introduction to C programming" by David M Collopy which comes with a microsoft visual C++ 6.0 compiler. The author uses the header file "#include <graph.h>", however whenever I try and compile the programme I get an error message (fatal error C1083) which says that there is "no such file or directory". I have conducted a search for the file and have found it in my C drive under program files. If someone is familiar with this compiler I would be grateful if they tell me how I can get this programme to compile successfully (source code is included below).
Many thanks
Martin
Code:
/******************************************************************
PRODUCTION OUTPUT: Load keyboard data into parallel arrays and
print the contents of the arrays.
Programme: CHAP10A.C
Author:
Date: 27.12.02
Project: Sample programme
*******************************************************************/
/*-----PREPROCESSING DIRECTIVE------------------------------------*/
#include <stdio.h>
#include <graph.h>
/*-----FUNCTION PROTOTYPES----------------------------------------*/
void LoadArrays(void); //Load data into arrays
void PrnArrays(void); //Print data from arrays
/*-----PROGRAMME SETUP--------------------------------------------*/
/*> PROGRAMME VARIABLES <*/
char sName [5][21]; //5 element 21 character array
int iProd [5]; //5 element integer array
/*------------------------------------------------------------------
MAINLINE CONTROL
-------------------------------------------------------------------*/
main()
{
_clearscreen(0);
//system("cls");
LoadArrays();
PrnArrays();
return 0;
//while(!kbhit());
}
/*------------------------------------------------------------------
LOAD DATA INTO ARRAYS
-------------------------------------------------------------------*/
void LoadArrays(void)
{
int iSub; //Array subscript
for (iSub = 0; iSub < 5; iSub++)
{
printf("Enter the employee name %d: ", iSub + 1);
scanf(" %20 [^\n]", sName [iSub]);
fflush(stdin);
printf("Enter production %d: ", iSub + 1);
scanf("%d", iProd [iSub]);
fflush(stdin);
}
return;
//while(!kbhit());
}
/*------------------------------------------------------------------
PRINT DATA FROM ARRAYS
-------------------------------------------------------------------*/
void PrnArrays(void)
{
int iSub; //Array subscript
printf("\nEMPLOYEE NAME PRODUCTION");
printf("\n________________________________");
for (iSub = 0; iSub < 5; iSub++)
{
printf("\n%-20s %2d", sName [iSub], iProd [iSub]);
}
return;
//while(!kbhit());
}
Code Tags added by Hammer