|
printf problem
I'm working with floats for calculations. I'm trying to use a printf statement to display the value of various floats, but I keep having problems. When I use %d, I get a wacky number over 37,000 which makes no sense. When I use %f, I get no output of the number at all. Could somebody tell me what I'm doing wrong. Here's an example of the format of how I'm doing my printf.
printf ("Value: %f /n", (float)value_name);
I've tried it with %f and %d... as well as trying to use my variables as "double" as well. Same problems though. Any help would be very much appreciated. Thanks!
|