cent and ucent?

Walter Bright newshound2 at digitalmars.com
Sun Jan 29 17:57:39 PST 2012


On 1/29/2012 3:31 PM, H. S. Teoh wrote:
> Yeah, size_t especially drives me up the wall. Is it %u, %lu, or %llu?
> I think either gcc or C99 actually has a dedicated printf format for
> size_t, except that C++ doesn't include parts of C99, so you end up with
> format string #ifdef nightmare no matter what you do. I'm so glad that
> %s takes care of it all in D. Yet another thing D has done right.

size_t does have a C99 Standard official format %z. The trouble is,

1. many compilers *still* don't implement it.

2. that doesn't do you any good for any other typedef's that change size.

printf is the single biggest nuisance in porting code between 32 and 64 bits.



More information about the Digitalmars-d mailing list