Re: pass by reference

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tuesday 12 February 2002 01:48 pm, Bernie Ryan wrote:
>
> atom addr_of_x
> addr_of_x = allocate(4)
>
> > foo(var integer x)
> >  x = 99
> > end
>
> procedure foo(atom addr_of_x)
>   poke4(addr_of_x,99)
> end procedure
>
> > foo(x)
> > ? x  => 99
>
> foo(addr_of_x)
> ? peek4u(addr_of_x) => 99

So now we have Euphoria with pointers.
The worst of both worlds.

I'm beginning to like C more and more.

Regards,
Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu