Mail Archives: djgpp/1998/06/12/19:45:34
"Ardy" wrote:
>Hi, I have a question, what do these errors mean?
> Type specifier omitted for parameter
You wrote a function declaration with no type given. You can't say, for
example, double f(x), you have to say double f(double x), or double f(int x),
or double f(char x), or whatever type x is.
> anonymous class type not used to declare any objects
> thanks,
You declared a class without giving the class a name (that's why it's
anonymous), and you didn't declare any variables of the class before the
semicolon, so you can't do anything with that declaration!
Let's say your class is declared as:
class {
// stuff here
};
You have to change it to
class A {
// stuff here
};
and then you can declare objects like:
A a;
Or you can change it to
class {
// stuff here
} a;
To declare an object without being able to reuse that declaration to define
more objects, or pass the object to functions, etc. (offhand, I can't think of
any reason you would want to do this, but I suppose there might be one).
Hope that helps.
____________________________________________
Matt Reece (swarsmatt AT aol DOT com)
____________________________________________
- Raw text -