I've fixed all but 1 error in my code which the compiler comes up with:
error C2664: 'fopen' : cannot convert parameter 1 from 'char' to 'const char *'
It says this error for line 2 and 3 of the snippet below:
Code:
char line[8];
ifp=fopen(inputFileName, "r");
ofp=fopen(outputFileName, "w");
/* Calculate each line until end of file */
while(fgets(line, 8, ifp) != NULL) {
sscanf (line, "%c", &inputRoman);
/* Call calculation procedure */
romanToArabic();
/* Print result into output text file */
fprintf(ofp, "The Arabic numeral for %c is %i", inputRoman, outputArabic);
}
fclose(ofp);
fclose(ifp);
Outside of void main() is:
Code:
FILE *ifp, *ofp;
char inputFileName, outputFileName, inputRoman;
int outputArabic;