Re: const &

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Which of the words "const" or "&" ensure that a parameter must be specified?
Thanks
Jack

"Jack" <jl@xxxxxxxxxxx> wrote in message
news:%23iABXJGCGHA.3984@xxxxxxxxxxxxxxxxxxxxxxx
> fn1( const Type & param )
>
> Hi,
> Do you agree that in the above statement
> 1. param can not be modified on the stack
> 2. But param = 3; in the local function would modify param on the heap.
> But won't the statement param = 3; in the local function throws exception
> because we are attempting to overwrite a constant variable?
> Thanks
> Jack
>


.



Relevant Pages

  • Re: ref parameter
    ... I'm going to *guess* that the stack looked ... (because param is passed in by reference) ... The DLL then merrily writes over SerialNo *and then part of 'address ... Rather, in that context, "param" refers to the original parameter, which is passed as an address stored in a location that is referenced as an offset relative to the current stack frame. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ref parameter
    ... I'm going to *guess* that the stack looked ... of param'*. ... of that is simply an offset relative to the current stack frame. ... But the address of the original parameter passed as "param" was stored in ...
    (microsoft.public.dotnet.languages.csharp)
  • Strange hang with Dns.GetHostEntry
    ... is tough to debug. ... The stack looks correct. ... The param is only ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: 200 horse on ftp tonight
    ... > 16 Paid, I finished 17th, lol. ... > Jack on 6th street for about 80% of my stack. ... mouth, ...
    (rec.gambling.poker)
  • Re: What Is What Is This Shit?
    ... Stack 'em up with The Band and let the night ... Jersey Jack ... Hey, I didn't say that those three were the best for that purpose, only ...
    (rec.music.dylan)