Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2000-09

Re: (no subject)

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe
Why cannot be output of function passed as const parameter of another function? Are there some fundamental difficulties with it?

The problem is that const parameters are passed by reference (ie. the address of the value is pushed instead of the value itself). Function results do not have an address.

Jonas

Reply by email

Florian Klaempfl
to Jonas Maebe
Jonas Maebe wrote
>Why cannot be output of function passed as const parameter of another >function? Are there some fundamental difficulties with it?

Can you please give an example which doesn't compile?

Show quoted text 5 lines
The problem is that const parameters are passed by reference (ie. the address of the value is pushed instead of the value itself). Function results do not have an address.

This is wrong!

Reply by email