Re: const int f() and int f() const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 19 Mar 2006, ab wrote:

>
> > Suppose there is a function f() which returns an integer and does not
> change
> > any value of the class it belongs to, should I declare it as:
> >
> > const int f();
> >
> > or
> >
> > int f() const;
>
> This one.
>
> > What is the difference? Thank you.
>
> The first one returns a 'const int.'

could you give an example where using that first declaration would
actually make a difference, given C's parameter-passing mechanism?
thanks.

rday
-
: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux