What you need is the sprintf function: http://manual.zorro-trader.com/str_.htm

You then generate a display string like this:

...
char message[80];
sprintf(message, "P = %i H = %.5f L = %.5f C = %.5f oscarvalue = %.3i",prevosc,A,B,D,oscarvalue);
goon = msg(message);
...

Note that you have to pass the variables to the function, otherwise there's nothing to display. Thus, writing a "general" displaydebugmsg function won't work this way because you need to tell the function somehow which variables you want to see.