Hi guys!
I get conflicting types, but I can't figure out why.
in "main.c" I have 2 header files defined.
compress.h
ReadFromFiles.h
Inside of "compress.h" I am using 1 function from "ReadFromFiles.h".
When I press "build" I get conflicting types. This is on the "ReadFileIntoArray" function.
This is the contents of "ReadFromFiles.h":
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* Prototype declarations. */
char ReadFromFiles (char InputFileName[], char *InMode);/* char *InMode = "r". */
char ReadFileIntoArray(char InputFileName[], char *InMode);
char ReadFileIntoArray(char InputFileName[], char *InMode)
{
unsigned int i; /* Counter. */
char Array[5000];
FILE *ifp;
/* Initialization. *//* "i" is initialized in the "for" cycle. */
ifp = fopen(InputFileName, InMode);
if (ifp == NULL)/* This checks the filename in the global variable "ofn.lpstrFile" and if its "0" displays the down message. */
{
printf("The dialog was canceled by the user, the file doesn't exists or doesn't have the right permissions!"); /* If the file can not be opened, quit. */
return -9998;
}
else
{
for(i=0; (feof(ifp)); i++)/* Main block. */
Array[i]=fgetc(ifp);
}
Array[i+1]='\n';
return Array;
}
char ReadFromFiles (char InputFileName[], char *InMode)/* char *InMode = "r". */
{
unsigned int i; /* Counter. */
char c;
FILE *ifp;
ifp = fopen(InputFileName, InMode);
if (ifp == NULL)/* This checks the filename in the global variable "ofn.lpstrFile" and if its "0" displays the down message. */
{
printf("The dialog was canceled by the user, the file doesn't exists or doesn't have the right permissions!"); /* If the file can not be opened, quit. */
return -9998;
}
else
{
return fgetc(ifp);
}
}