小编gal*_*air的帖子

How to print a pointer address without printf

I'm doing an exercise in which I need to print the memory (address) of a pointer. It would be easy to do it with printf("%p", ..) but I'm not allowed to use it.

Do you know how I can get the address without using printf()? The only function I can use is 'write'.

Here is the statement of my exercise :

Write a function that takes (const void *addr, size_t size), and displays the memory as in the …

c arrays printf pointers

2
推荐指数
1
解决办法
5276
查看次数

标签 统计

arrays ×1

c ×1

pointers ×1

printf ×1