I noticed today that I can't use * to pass width or precision arguments to Java's implementation of printf.
That is, the following arguments to printf are valid in C, but not Java:
"%*d", 10, 3
"%-*d", 10, 3
"%0*d", 10, 3
"%*.5f", 11, 1.0/9
"%-11.*f", 5, 1.0/9
"%0*.*f", 11, 5, 1.0/9
Are there any other implementation differences I should be aware of?
解决方案
I wouldn't think of it as differences. I'd just read through the Java documentation carefully and go entirely from that. Thinking in terms of differences is likely to lead to things slipping through the net.
In other words, I'd treat the similarities as coincidences, and assume the two are different until proven otherwise :)