Hello All,
I am working on a project using tiva c launchpad with kentec booster pack using Grlib for a graphic application development.
I am using "canvas" in one of my screen where I want to assign text converted from integer (such as "123"). I am using following code:
uint32_t Number = 1234; (This is Variable changes b/w 0 to 2^32 in run time)
char result[15];
ltoa(Number,result); (stdlib function to convert long to string)
CanvasTextSet(&Num_Cycles,result); (to assign result string to canvas)
WidgetPaint((tWidget*)&Num_Cycles);
When I do this I am getting garbage text on canvas instead of "1234". The converted string is proper with null termination.
Can any one let me know why this is happening.
(FYI: If I do CanvasTextSet(&Num_Cycles,"1234"); It is proper but I can't do as string is not constant)
Thank you.
-Nagendra.