Thread overview
default c'tor - syntax problem
Feb 09, 2003
Richard Grant
Feb 09, 2003
Christof Meerwald
Feb 09, 2003
Richard Grant
February 09, 2003
The example below compiles fine with "A a();" in main replaced with "A a;".

AFAIK there should be no problem with either syntax..

struct A {
A() { }
void fn() { }
};

void main() {
A a();
a.fn();
// Error: not a struct or union type
// Warning 6: value of expression is not used
}

Low priority.

Richard


February 09, 2003
On Sun, 9 Feb 2003 16:13:39 +0000 (UTC), Richard Grant wrote:
> void main() {
> A a();

This declares "a" as a function returning A.

> a.fn();
> // Error: not a struct or union type
> // Warning 6: value of expression is not used
> }

AFAIK, DMC's behaviour is correct.



bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw@jabber.at mailto cmeerw at web.de

...and what have you contributed to the Net?
February 09, 2003
In article <b260id$2c3g$1@digitaldaemon.com>, Christof Meerwald says...
>
>On Sun, 9 Feb 2003 16:13:39 +0000 (UTC), Richard Grant wrote:
>> void main() {
>> A a();
>
>This declares "a" as a function returning A.
>
>> a.fn();
>> // Error: not a struct or union type
>> // Warning 6: value of expression is not used
>> }
>
>AFAIK, DMC's behaviour is correct.

And you are correct.. Thanks,

Richard