Mail Archives: djgpp/1999/04/13/05:39:20
thethoms <thethoms AT pacbell DOT net> writes:
> while (class[counter]!=-1)
> {
> Sample=pow((class[counter]-Mean),2)
^^^
(missing semicolon)
> }
> StdDev=sqrt(Sample/(classnumber-1))
^^^
(missing semicolon)
> When I compile this program, where ever there is a statement like:
>
> class[XXXX]
>
> I receive an error from the compiler:
>
> Parse error before XXXX
That's because "class" is a C++ keyword. You can't use it for anything
else like a variable or function name. You need to choose a name that
isn't a reserved word.
> I have had my C++ instructor look at these statements, and she
> can't seem to find anything wrong.
Hehe. Why is it that computing teachers never seem to know how to
program? :-)
Shawn Hargreaves.
- Raw text -