[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

constant variable, local and passing to methods

puzzlecracker

10/1/2008 5:51:00 PM

How can I pass a reference to a method as constant?

I tried the following:

Function(const Foo f) or Function(readonly Foo f)


Also, How to declare local variable to be constant

const Foo foo or readonlyFoo f?
2 Answers

Obnoxious User

10/1/2008 6:34:00 PM

0

On Wed, 01 Oct 2008 10:50:39 -0700, puzzlecracker wrote:

> How can I pass a reference to a method as constant?
>
> I tried the following:
>
> Function(const Foo f) or Function(readonly Foo f)

void Function(Foo const & f);

>
>
> Also, How to declare local variable to be constant
>
> const Foo foo or readonlyFoo f?

Foo const f;

--
OU
Remember 18th of June 2008, Democracy died that afternoon.
http://frapedia.se/wiki/Information_...

puzzlecracker

10/1/2008 8:28:00 PM

0

On Oct 1, 2:34 pm, Obnoxious User <O...@127.0.0.1> wrote:
> On Wed, 01 Oct 2008 10:50:39 -0700, puzzlecracker wrote:
> > How can I pass a reference to a method as constant?
>
> > I tried the following:
>
> > Function(const Foo  f) or  Function(readonly Foo  f)
>
> void Function(Foo const & f);
>
>
>
> > Also, How to declare local variable to be constant
>
> > const Foo foo or readonlyFoo f?
>
> Foo const f;
>
> --
> OU
> Remember 18th of June 2008, Democracy died that afternoon.http://frapedia..se/wiki/Information_in_English

argh, again sent it to the wrong group.. IHMO