www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/12/19:45:34

From: swarsmatt AT aol DOT com (SWars Matt)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP:What Do there errors mean?
Lines: 40
Message-ID: <1998061223323000.TAA18557@ladder03.news.aol.com>
NNTP-Posting-Host: ladder03.news.aol.com
Date: 12 Jun 1998 23:32:30 GMT
Organization: AOL http://www.aol.com
References: <35819545 DOT 68C2DEA5 AT earthlink DOT net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

"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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019