P
P
Pinkman2020-08-12 07:12:07
C++ / C#
Pinkman, 2020-08-12 07:12:07

How to show an address in memory?

Good afternoon!
Not long ago I learned that through printf(“%p”, &var);You can see exactly where the variable lies.
The question is, how can I do the same without using the printf?
Ps For witty commentators, I’ll explain, the problem is not how and where to output (at least to paper through a printer), but how to get an address in memory that can be printed ...
I don’t need any ready-made functions. And infa from debuggers too. Roughly speaking, I want to do this:

char *moya_func(void *ptr);

int main(void)
{
    void *ptr;
    napechatat_v_printer_adres(moya_func(&ptr));
    return 0;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
cython, 2020-08-12
@cython

You can use any other console output function (conio, system api). But it will be the same.

G
Griboks, 2020-08-12
@Griboks

With the help of the debugger (and profiler), you can see a lot more interesting things.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question