Not sure if this is a compiler issue, but that doesn't seem to output it correctly (VS 2005).
What is happening is I am reading the data from a bitmap file and am applying the header to a struct I have.
For my program, I am going to need to make use of some of these values. When I use %ul as you suggested, I get a result of 0l, far from correct.
typedef unsigned long DWORD;
if((fp = fopen(input, "rb")) == NULL) return 0;
fread(&bmfh, sizeof(bmfh), 1, fp);