I wish I could say
printf("%*.16xs", n, p);
where n is a size_t and p is a void*, and it would output n bytes as hex. And I want to be able to say
printf("%*qs", n, p);
and it would output n bytes as a C-style backslash quoted string. Yes, I can write functions that do all this, but I have to worry about buffers, allocate buffer space, and so forth. Plus its a lot of noise and clutter, for just outputing potentially unprintable strings, often just for logging and debugging. Tags: geek, mysql Current Location: University of Tasmania, Hobart, Tasmania, Australia
|