What you should do is not use them. They are C, not C++.
EDIT: Actually they seem to be in C++11
Code:firas@itsuki ~ % cat test.cpp #include <cinttypes> #include <cstdio> int main(void) { uint64_t x = 5; printf("%" PRIu64 "\n", x); } firas@itsuki ~ % g++ -std=c++11 -o test test.cpp firas@itsuki ~ % ./test 5
Last edited by Bachstelze; January 6th, 2013 at 11:53 AM.
Thanks,
C seems to work out of the box (without -std=c11):
gcc test.c -o test
~$ ./testCode:#include <inttypes.h> #include <stdio.h> int main() { uint64_t x = 5; printf("%" PRIu64 "\n", x); return 0; }
5
~$
I guess I'll stick with llu or lu until recent Linux distros switch to C++11 by default.
Last edited by bird1500; January 6th, 2013 at 01:39 AM.
Bookmarks