This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sprintf with long?

Hello,

I am trying to create a string with a variable of type long, using sprintf.

char command [20];
long ofs = 363080;

sprintf (command, "VAL=%d", ofs);
The output string I get is this:
VAL=-30136
which means that the long variable was converted into a short.
Does sprintf not support long types?

Thank you for your help!
Holger

0