1 Reply Latest reply on Jul 3, 2017 10:48 AM by JoMe_264151

    Float to Hex Conversation Error in Psoc-1 creator




      I have been working on converting float value to hex value through different method.


      like this:


      int main() 


          char str[32];


          float a = 3.1415927;
          sprintf(str,"%X", *(int *)&a);


          return 0;


      This is small part of my whole program. This is working perfect with C normal IDE software but when i add this program in creator.it gives error like this:


      type error in argument 2 to `sprintf'; found `pointer to __flash char' expected `pointer to char'


      can anyone explain me how can i overcome this error??


      i need to convert float value to hex value for my program.