Sign in Join

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

Mailing lists / fpc-pascal / 2013-01

pointer address safety

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

ik

Hello,

What is the safest (no memory corruption etc...) way to use format string, and by using '%P' pass a class memory address ?

Does casting to Pointer good, or is it unsafe ?

Thanks,
Ido

Reply by email

Sven Barth
to ik
ik wrote 6 lines
Hello, What is the safest (no memory corruption etc...) way to use format string, and by using '%P' pass a class memory address ? Does casting to Pointer good, or is it unsafe ?

As Format does not support objects being provided to it you MUST even cast to Pointer if you want it printed. :)

And as classes instances are implicit pointers there is no problem...

Regards,
Sven

Reply by email

ik
to Sven Barth
Sven Barth wrote 14 lines
On 31.01.2013 19:55, ik wrote: > > Hello, > > What is the safest (no memory corruption etc...) way to use format > string, and by using '%P' pass a class memory address ? > > Does casting to Pointer good, or is it unsafe ? As Format does not support objects being provided to it you MUST even cast to Pointer if you want it printed. :) And as classes instances are implicit pointers there is no problem...

Thanks :)

Show quoted text 7 lines
Regards, Sven _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email