PDA

View Full Version : [C] how to print ulong?



days_of_ruin
November 16th, 2008, 10:16 PM
I am actually coding it in vala but I am assuming that its exactly
the same because vala just generates c code.
%d is for int but what do you use for a ulong?

Nemooo
November 16th, 2008, 10:25 PM
It's %lu.

nvteighen
November 16th, 2008, 10:25 PM
Isn't it %uld? (%ld is for long)

Nemooo
November 16th, 2008, 10:30 PM
There's no need for the d, since u is of type unsigned int. Only if it's not of type int you have to prefix u.

days_of_ruin
November 16th, 2008, 10:56 PM
It's %lu.

Thanks that works.