%lu
is the correct format for unsigned long
. Sounds like there are other issues at play here, such as memory corruption or an uninitialized variable. Perhaps show us a larger picture?
Related Posts:
- Correct format specifier for double in printf
- Scanf/Printf double variable C
- What is the argument for printf that formats a long?
- How I can print to stderr in C?
- What does “%.*s” mean in printf?
- error: aggregate value used where an integer was expected
- How do you format an unsigned long long int using printf?
- How many spaces for tab character(\t)?
- Strings and character with printf
- printf() formatting for hexadecimal
- Printing hexadecimal characters in C
- What is the printf format specifier for bool?
- ‘printf’ vs. ‘cout’ in C++
- Is there a printf converter to print in binary format?
- what is the unsigned datatype?
- Unsigned long in Java
- How to print a char array in C through printf?
- How to printf a memory address in C
- Data argument not used by format strings in C
- How can one print a size_t variable portably using the printf family?
- %i or %d to print integer in C using printf()?
- How can you print multiple variables inside a string using printf?
- How to print an unsigned char in C?
- C’s printf and fprintf(stdout,) are not printing
- Is there a way to have printf() properly print out an array (of floats, say)?
- How do you allow spaces to be entered using scanf?
- How to write to a file using open() and printf()?
- Using floats with sprintf() in embedded C
- Printf width specifier to maintain precision of floating-point value
- Which of sprintf/snprintf is more secure?
- Does C have a string type?
- Execution of printf() and Segmentation Fault
- How to find EOF through fscanf?
- Why is the sizeof(int) == sizeof(long)?
- printf format specifiers for uint32_t and size_t
- How to repeat a char using printf?
- How to display hexadecimal numbers in C?
- Two decimal places using printf( )
- What primitive data type is time_t? [duplicate]
- Reading float using scanf in c
- How to format strings using printf() to get equal length in the output
- Reading float using scanf in c
- How to format strings using printf() to get equal length in the output
- What do \t and \b do?
- write() to stdout and printf output not interleaved?
- %p Format specifier in c
- What causes a segmentation fault (core dump) to occur in C?
- How to use symbols of extended ASCII table in C?
- Arrow operator (->) usage in C
- typedef struct vs struct definitions [duplicate]
- Floating point exception( core dump
- Why am I getting “void value not ignored as it ought to be”?
- 1 = false and 0 = true?
- What is an unsigned char?
- How to go from fopen to fopen_s
- Write to .txt file?
- What does #pragma once mean in C? [duplicate]
- What is the difference between const int*, const int * const, and int const *?
- Connect: Socket operation on non-socket
- C library function to perform sort
- Try catch statements in C
- conflicting types error when compiling c program using gcc
- Get the current time in C
- What is a file with extension .a?
- error: indirection requires pointer operand (‘int’ invalid)
- Cache Simulator in C
- strcmp giving segmentation fault
- What does “pointer being freed was not allocated” mean exactly?
- How to run valgrind with basic c example?
- Initialization from incompatible pointer type warning when assigning to a pointer
- Typedef function pointer?
- How to use timer in C?
- Convert char array to a int number in C
- What is the difference between stdin and STDIN_FILENO?
- What is the difference between %f and %lf in C?
- How to simply convert a float to a string in c?
- Is there a replacement for unistd.h for Windows (Visual C)?
- What is the difference between char array and char pointer in C?
- How to copy a char array in C?
- How to project a point onto a plane in 3D?
- hash function for string
- Why use pointers?
- What happens during a “relocation has invalid symbol index” error?
- error C2371: ‘functionname’ redefinition: different basic types
- configure: error: cannot run C compiled programs
- note: previous implicit declaration of ‘point_forward’ was here
- What exactly is meant by “de-referencing a NULL pointer”?
- getc() vs fgetc() – What are the major differences?
- Error: “Access not within mapped region at address” (Valgrind)
- char array not assignable
- Warning: comparison of distinct pointer types
- getline() vs. fgets(): Control memory allocation
- Library for the Basic Data Structures, such as Queue, in C
- How to run C program on Mac OS X using Terminal?
- Using sys/socket.h functions on windows
- Segmentation fault- strcat
- Difference between exec, execvp, execl, execv?
- stack around the variable…was corrupted
- Convert Char to String in C
- How to print a int64_t type in C