Hello,
I've nearly finished writing a program that converts Roman to arabic numbers, but i've run into a problem to do with the "Batch Mode" of the program.
The batch mode involves asking the user to type in the file name (a text file) which contains Roman numerals that need to be converted by the program. After reading the filename, it is supposed to open and read it.
For some reason, everytime i type in the filename to be scanned in and read, an assertion error appears. Now i have only been working for C++ for a little over a month, but i cant identify the error.
What am i doing wrong?
a snippet of the code i'm using for the 'Batch Mode':
//BATCH CONVERSION//
else if(menu_select==2)
{
char romNum [80];
char fileName[80];
FILE * file_numerals;
printf ("-------------------------------------\n");
printf ("-------- 2. BATCH CONVERSION --------\n");
printf ("-------------------------------------\n");
printf ("\nPlease type the name of the file you want to open below.\nName(including suffix): ");
scanf ("%s", &fileName);
file_numerals = fopen (("%s", fileName),"r");
rewind (file_numerals);
while (!feof(file_numerals));
{
fscanf (file_numerals, "%s", &romNum);
}
fclose (file_numerals);
printf ("You have chosen to convert the following characters: %s \n",romNum);
int roman;
return 0;
}
Thanks to anyone who can help me.