For int64_t
type:
#include <inttypes.h> int64_t t; printf("%" PRId64 "\n", t);
for uint64_t
type:
#include <inttypes.h> uint64_t t; printf("%" PRIu64 "\n", t);
you can also use PRIx64
to print in hexadecimal.
cppreference.com has a full listing of available macros for all types including intptr_t
(PRIxPTR
). There are separate macros for scanf, like SCNd64
.
A typical definition of PRIu16 would be "hu"
, so implicit string-constant concatenation happens at compile time.
For your code to be fully portable, you must use PRId32
and so on for printing int32_t
, and "%d"
or similar for printing int
.
Related Posts:
- Compiler Error “void value not ignored as it ought to be” in C programming [duplicate]
- C compiler for Windows?
- Why the range of int is -32768 to 32767?
- max value of integer
- c array – warning: format not a string literal
- Valgrind Invalid free() / delete / delete[] / realloc() in C
- C’s printf and fprintf(stdout,) are not printing
- error: unknown type name ‘bool’
- Representing EOF in C code?
- How to display hexadecimal numbers in C?
- Example of realpath function in C
- api-ms-win-crt-runtime-l1-1-0.dll is missing when opening Microsoft Office file [closed]
- Istio Ingress resulting in “no healthy upstream”
- What is a LAMP stack?
- What is the difference between POST and PUT in HTTP?
- What and where are the stack and heap?
- What is a reverse shell?
- warning: implicit declaration of function
- Why am I getting error for apple-touch-icon-precomposed.png
- What is the difference between float and double?
- How could I ping @here in Discord.py?
- ssh remote host identification has changed
- How to link to part of the same document in Markdown?
- “Expected expression before ‘ { ‘ token”
- How to generate a random int in C?
- C pointers and arrays: [Warning] assignment makes pointer from integer without a cast
- How to print the array?
- How to solve the error: assignment to expression with array type
- segmentation fault : 11
- In C programming, what is `undefined reference`error, when compiling?
- In C++, what is wx.h?
- How to UPSERT (MERGE, INSERT … ON DUPLICATE UPDATE) in PostgreSQL?
- What is the difference between allFile and allMarkdownRemark in gatsby
- DynamoDB : The provided key element does not match the schema
- How do I run a single test using Jest?
- #31 expression must have integral type
- How do you pass a function as a parameter in C?
- PHP &$string – What does this mean?
- Simple C program to read a file line by line
- Best C/C++ Network Library
- How can I get argv[] as int?
- Update Git branches from master
- Why I do get “Cannot find bound of current function” when I overwrite the ret address of a vulnerable program?
- Warning: assignment from incompatible pointer type
- declaring a priority_queue in c++ with a custom comparator
- How do malloc() and free() work?
- How to interactively (visually) resolve conflicts in SourceTree / git
- Using true and false in C
- Undefined Reference issues using Semaphores
- What is time(NULL) in C?
- Is there an online application that automatically draws tree structures for phrases/sentences?
- Create new tmux session from inside a tmux session
- classic ASP error ‘80020009’ Exception occurred
- Disable Chrome pinch zoom for use in kiosk
- How to ‘minify’ Javascript code
- C++ – Too Many Initializers for Arrays
- Reading string by char till end of line C/C++
- How to use EOF to run through a text file in C?
- How can one see content of stack with GDB?
- RGBA code for red color
- java array error “array required but int found”
- this: Cannot use this in static context
- Is there any difference between 1U and 1 in C?
- segmentation fault: 11 in C code
- Fail to create Android virtual Device, “No system image installed for this Target”
- Proper way to empty a C-String
- malloc(): memory corruption
- Warning: X may be used uninitialized in this function
- Warning: session_start(): Cannot send session cookie – headers already sent by (output started at [duplicate]
- Using OpenMP with clang
- Reading in double values with scanf in c
- Simple C scanf does not work? [duplicate]
- Reaching EOF with fgets
- Difference between char* and char** (in C)
- Cross Platform C library for GUI Apps?
- Pre increment vs Post increment in array
- ifference between ibatis and mybatis
- How to install PyQt4 on Windows using pip?
- meaning of &variable (passed to function)
- Printing a 2D array in C
- How to make a redirection that fired a script before redirecting?
- Create post and update in the same flow [closed]
- How do I deal with a compromised server?
- Something is burning in the server room; how can I quickly identify what it is?
- Finding out what user Apache is running as?
- Do systemd unit files have to be reloaded when modified?
- What is a glue record?
- How do I convert a .cer certificate to .pem?
- Run Oracle SQL script and exit from sqlplus.exe via command prompt
- Show full process name in top
- How do you do load testing and capacity planning for web sites?
- What is a good SSH server to use on Windows? [closed]
- In systemd, what’s the difference between After= and Requires=?
- Windows Server restart / shutdown history
- How do I set the global PATH environment variable on OS X?
- nmap find all alive hostnames and IPs in LAN
- Should CNAME Be Used For Subdomains?
- How do I create user accounts from the Terminal in Mac OS X 10.5?
- How to get a .pem file from ssh key pair?