it means you have allocated too few characters.
Look, the minimal %.3f means:
first character: one digit 1+
second character: . 1+
next three characters: decimals 3
as you can see there are already five characters. The sixth is '\0' and also will be put by the function sprintf. So after filling cx, the next character is taken from cz. It means the stack around cz is corruped. So, you should allocate more than five characters. I advise you to put at least 16 characters for each variable:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.