相关疑难解决方法(0)

使用std :: cout时如何模拟printf的%p格式?

unsigned char *teta = ....;
...
printf("data at %p\n", teta); // prints 0xXXXXXXXX
Run Code Online (Sandbox Code Playgroud)

如何使用iostreams 打印变量地址?有吗std::??? 功能就像std::hex做这种转换(地址 - >字符串),那么std::cout << std::??? << teta << std::endl会打印那个地址吗?

(没有sprintf的,请;))

c++ gcc iostream

18
推荐指数
1
解决办法
8128
查看次数

标签 统计

c++ ×1

gcc ×1

iostream ×1