Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Does Printf support the "I" size spec?

May
12,846
164
That's "I", uppercase "i" ... for types like size_t which are either 32 or 64 bit?
 
It supports %I64... - but why would you use that instead of the Windows functions?
I don't understand. Do you mean wprintf() (which supports "%Iu")? I've always thought that Printf(), and friends, were THE way to output in a plugin. How do you handle outputting a size_t which is 32 bits on x86 system and 64-bits on x64?
 
It supports %I64... - but why would you use that instead of the Windows functions?

The Windows functions may behave differently if e.g. output is redirected to stderr.

If you need to you can wsprintf() to a buffer, and then QPuts() or Printf() that.
 
The Windows functions may behave differently if e.g. output is redirected to stderr.
If you need to you can wsprintf() to a buffer, and then QPuts() or Printf() that.
Yes, that's what I figured Printf() and friends were all about.
I use wsprintf() a lot. But I don't think it has a size/type spec that's automatically 32 or 64 bits as would be needed by a size_t parameter. OTOH, swprintf() does, but using it, or anything in the printf() family, adds about 16KB to the exe/dll.
 
Back
Top