I\'m trying to work out why a larger problem is occurring, using a smaller program as an example. This smaller program does not work, leading me to believe it is my understa
This is because 5 is an integer (int), and you're telling sprintf to pretend that it's a double-precision floating-point number (double). You need to change this: