fatal error C1004: unexpected end-of-file found
May 1, 2011 at 9:55pm UTC
Hi guys, I am working with C functions and I wrote a simple program to compute the maximum and minimum of two numbers. I split the functions into separate files (main.c, computemaxmin.h, computemax.c, computemin.c however when I compile using , I get the following error:-
fatal error C1004: unexpected end-of-file found
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
//main.c
#include <stdio.h>
#include "computeMaxMin.h"
int main(void )
{
double firstInput, secondInput, maximum, minimum;
printf("Please enter two numbers\n" );
scanf("%lf %lf" , &firstInput, &secondInput);
maximum = ComputeMaximum(firstInput, secondInput);
printf("The larger number is %f " , maximum);
printf("\n" );
minimum = ComputeMinimum(firstInput, secondInput);
printf("The smaller number is %f " , minimum);
printf("\n" );
return 0;
}
//computemin.c
double ComputeMinimum (double numberOne, double numberTwo)
{
double result;
result = (numberOne < numberTwo) ? numberOne : numberTwo;
return result;
}
//computemax.c
double ComputeMaximum (double firstNumber, double secondNumber)
{
double result;
result = (firstNumber > secondNumber) ? firstNumber : secondNumber;
return result;
}
//computemaxmin.h
#ifndef COMPUTEMAXMIN_H
#define COMPUTEMAXMIN_H
double ComputeMaximum(double firstNumber, double secondNumber);
double ComputeMinimum(double numberOne, double numberTwo);
#endif /* COMPUTEMAXMIN_H */
I don't understand why I am getting this error, the code looks fine to me, unless I am missing something.
May 2, 2011 at 12:23am UTC
SOLVED! Need an enter after the #endif!
Topic archived. No new replies allowed.