[Lazarus] Library function trashing object
Leonardo M. Ramé
l.rame at griensu.com
Fri Apr 19 21:37:04 CEST 2013
On 2013-04-19 21:24:50 +0200, Lubos Pintes wrote:
> This is How I understand the var parameter.
> It is an address, but is treated as normal variable, so it is not
> needed to dereference a pointer.
> For example
> int f(int* x) in C/C++ corresponds to
> function f(var x: integer): integer;
> Now we have
> int f(int x);
> If you declare it as
> function f(var x: integer): integer;
> and then try to assign something to x, the access violation is very
> probably raised because x contains value, not address.
Thanks for the explanation Lubos, much clear now.
--
Leonardo M. Ramé
http://leonardorame.blogspot.com
More information about the Lazarus
mailing list