- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
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.
Solved! Go to Solution.
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For PSoC1 use csprintf() when the format is (as usual) a const string in flash.
Greetings from John von Neumann 😉
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For PSoC1 use csprintf() when the format is (as usual) a const string in flash.
Greetings from John von Neumann 😉
Bob