sprintf stops execution
1 - You have to Include the stdio.h , gcc will provide fake function read about “warning: implicit declaration of function”.
2 - Make sure the optimzation is turned off and max for debugging
3 - The code you write does not compile, so please provide the code as in IDE
best reagds,
Mazen