I'm having some problems with this code:
The only output I care about of course is from the printf() with all floats, but I can't figure out why I get weird input from the second printf().
struct Note *gnote = malloc(sizeof(struct Note));
noteprepare(gnote, 2); /*fill *gnote with some data*/
printf("%f %f %f\n\n", gnote->duration, gnote->ampvalue, gnote->pitchvalue);
printf("%f %d %f\n\n", gnote->duration, gnote->ampvalue, gnote->pitchvalue);
Here is an example of what I get:
0.250000 2000.000000 587.299988
0.250000 0 26815622315368532000000000000000000000000000000000000000000000000
The first line of output is exactly what I want, but I don't understand what's going on with the second.
0.000000 2300.000000 659.260010
0.000000 0 -0.000000
Thanks for your help
PS I'll pose noteprepare() if anyone thinks it will be helpful
PPS I'm using WindowsXP with MinGW