http://www.ohchr.org。
The following code work as expected in g++ 4.4.0 under mingw32:
#include <cstdio>
int main()
{
long long x = 0xdeadbeefc0defaceLL ;
printf ("%llx
", x) ;
}
但是,如果我能够用<代码>-Wall发出所有警告,那么它就说:
f.cpp: In function int main() :
f.cpp:5: warning: unknown conversion type character l in format
f.cpp:5: warning: too many arguments for format
该编码与<代码>%lld相同。 这是否在新版本中确定?
Edited again to add:
The warning doesn t go away if I specify -std=c++0x
, even though (i) long long
is a standard type, and (ii) %lld
and %llx
seem to be officially supported. For instance, from 21.5 Numeric conversions para 7:
Each function returns a string object holding the character representation of the value of
its argument that would be generated by calling sprintf(buf, fmt, val) with a format specifier of
"%d", "%u", "%ld", "%lu", "%lld", "%llu", "%f", "%f", or "%Lf", respectively, where buf designates
an internal character buffer of sufficient size.
因此,这确实是一个 b?