Bigfoot
New member
c1001 error, line 2701 is msc1.ccp. Heres my code:
bool next_file()
{
//moving to next filenum
current.filenum++;
//need dummy filenum
int dumnum = current.filenum;
//preparing divisor
int mult = 1;
int i;
for (i = current.file_firstnum; i < current.file_lastnum; i++)
mult = mult*10;
//changing current.filename
for (i = current.file_firstnum; i <= current.file_lastnum; i++)
{
if (dumnum/div > 0) //c++ compiler error?!
{
current.filename = dumnum/div + 48;
dumnum = dumnum - (dumnum/div)*div;
div = div/10;
}
else
{
current.filename = 48;
div = div/10;
}
}
//checking file exists
ifstream checksFile;
checksFile.open(current.filename, ios::in);
if (checksFile.fail())
return 0;
else
{
checksFile.close();
return 1;
}
}
This is just one function, I get the error on the first if after the main for statement: "if (dumnum/div > 0)".
The code looks clean to me, but obviously I'm missing something. Program compiles fine without this function, but unfortunately I *need* this function. Any suggestions?
bool next_file()
{
//moving to next filenum
current.filenum++;
//need dummy filenum
int dumnum = current.filenum;
//preparing divisor
int mult = 1;
int i;
for (i = current.file_firstnum; i < current.file_lastnum; i++)
mult = mult*10;
//changing current.filename
for (i = current.file_firstnum; i <= current.file_lastnum; i++)
{
if (dumnum/div > 0) //c++ compiler error?!
{
current.filename = dumnum/div + 48;
dumnum = dumnum - (dumnum/div)*div;
div = div/10;
}
else
{
current.filename = 48;
div = div/10;
}
}
//checking file exists
ifstream checksFile;
checksFile.open(current.filename, ios::in);
if (checksFile.fail())
return 0;
else
{
checksFile.close();
return 1;
}
}
This is just one function, I get the error on the first if after the main for statement: "if (dumnum/div > 0)".
The code looks clean to me, but obviously I'm missing something. Program compiles fine without this function, but unfortunately I *need* this function. Any suggestions?