Daniel T.
11/28/2008 5:34:00 PM
Lionel B <me@privacy.net> wrote:
> On Fri, 28 Nov 2008 06:46:20 -0800, James Kanze wrote:
> > On Nov 28, 11:14 am, anon <a...@no.invalid> wrote:
> > > Ravi wrote:
> > > > I created a class in C++ with method names "set" and "get" and
> > > > got the following error messages (with a few others which
> > > > related to same problem I think):
> > > >
> > > > "error: ISO C++ forbids declaration of 'set' with no type"
> > > > "error: ISO C++ forbids declaration of 'get' with no type"
> > > >
> > > > Why this is so and what should be naming conventions for
> > > > methods in C++?
> > >
> > > I just tried your example, and my compiler didn't complain.
> >
> > He didn't give an example, so how could you try it. He didn't
> > give any information, so there's really no way we can help him.
>
> And there was me thinking "anon" was being ironic...
When I compile the OP's example, it compiles fine, but it crashes at
runtime. (missing main function.) The OP's example code also compiles
fine on the Comeau on-line compiler. Once again, his example code in its
entirety: