lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> > 
> >    Lua 5.4.2  Copyright (C) 1994-2020, PUC-Rio
> >    > string.format("%p", print)
> >    0x5626ad9b2709
> >    > print(print)
> >    function: 0x5626ad9b2709
> On my Windows 10 these addresses are output without 0x. Why is it different?

Lua uses C's 'printf' to do this formatting. C has no rules about how it
does that. By the book, it does not even has to be a number.  All the
standard says is this:

   The value of the pointer is converted to a sequence of printing
   characters, in an implementation-defined manner.

-- Roberto