我要为等效printf("%2.2x", var);于cerr<<在C++中.
码:
typedef unsigned char byte;
static byte var[10];
for(i=1; i<10; i++)
printf("%2.2x", var[i]);
Run Code Online (Sandbox Code Playgroud)
我的想法是将调试重定向到这样的文件:./myprog 2>out.txt.
如果我不要求太多,我也想收到解释.
谢谢!
nul*_*ptr 14
使用fprintf(stderr, ...),例如:
fprintf(stderr, "%2.2x", var[i]);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7105 次 |
| 最近记录: |