Does Printf (et al.) have a size_t size spec?

May 20, 2008
12,167
133
Syracuse, NY, USA
Does Printf (and friends) have a size specification that's 32 bits on x86 and 64 bits on x64?

Thanks.
 
May 20, 2008
12,167
133
Syracuse, NY, USA
Charles, can you explain further? %X in the HEX type and I'd expect a prefix with it. What's %q?
OK, now I see the notes in TakeCmd.h. Hmmm! I've never used %q. And I have always used %X as in C/Win32 ... uppercase hex, with a prefix (usually l or I64) and never casting the matching argument.
 
Aug 23, 2010
688
9
That's why I asked, what you want to achieve. Because your question strikes prominently as an XY problem to me.
 
May 20, 2008
12,167
133
Syracuse, NY, USA
A related and more specific question:

Suppose I have a HANDLE h (void*, 32 or 64 bits) and I want to do this

Code:
Sprintf(szExpr, L"%%@FILECLOSE[<type>]", (cast?) h);
ExpandVariables(szExpr, 0);

Does Sprintf() know about the q type? Can I
Code:
Sprintf(szExpr, L"%%@FILECLOSE[%q]", (ULONGLONG) h);