When using sprintf with float variables, I get the following warning (and the output string gives a "(NULL)" in the place of the variable).
warning: passing arg 1 of `sprintf' from incompatible pointer type
warning: double format, float arg (arg 3)
warning: double format, float arg (arg 3)
Example code:
void showfloat( )
{
float tempfloat;
char *buf[20];
tempfloat = 9.40;
sprintf( buf, "%.0f", tempfloat );
usart1Puts( buf );
}
Is there a workaround for this?
Thanks
-Mark
