c - Long Long to char conversion function in embedded system
问题 Im working with a embedded system and I need implement a way to convert long long to char. The problem is that I can not use sprintf in this system to do that, so im looking for alternative ways/functions to implement this. Suggestions of implementations for LongLongToChar function are welcome. 回答1: Google "itoa". There are many variations. Here's an example. char* itoa(int val, int base){ static char buf[32] = {0}; int i = 30; for(; val && i ; --i, val /= base) buf[i] = "0123456789abcdef"