In article <yC*********************@twister.southeast.rr.com> ,
pentiumPunk <Br***@triad.rr.com> wrote:
for some reason i thought i could have more if statements than else
statements.
if (!inputFile)
{
cerr<<"file not found";
}
if (something)
{
do operation;
}
else
{
do somethingElse;
}
in g++, i get an error message saying "parse error before else" which
translated to visual c++ means not same amout of elses as if's. i didnt know
that was illegal. was i wrong?
The sort of thing you have above *should* compile as two separate
if-statements, the first one without an else-clause. But that's not
compilable code anyway. Post a short complete example program that
compiles cleanly *except* for the error message that you describe above.
--
Jon Bell <jt*******@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA