Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Converts an integer to a string.
Converts an integer to a string.
Try this answer, blogs.com/ahuangliang/p/3602441.html.

# Definition? BASE_MAX? (26? +? 10)

Charles? const*? itostr(int? x,? int? Base)

{

/*? Map? Center,? Negative remainder of skill? */

Static electricity Charles? const? *? const? Map? =?

& amp" zyxwvutsrqponmlkjihgfedcba 98765432 1 "

? " 0 123456789 abcdefghijklmnopqrstuvwxyz "

? 【BASE_MAX? -? 1];

/*? Static buffering does not support multithreading. Does every call overwrite the last value? */

Static electricity Charles? buf[BASE _ MAX];

int? oldx

/*? Reverse use from the buffer tail? */

char*? p? =? buf? +? sizeof(buf)? -? 1;

*p? =? '\0';

/*? Illegal base returned an empty string. */

What if? (base? & lt? 2? ||? Base? & gt? 36)? {

Return? p;

}

Do what? {

/*? Save the original number and replace modulo */

oldx? =? x;

x? =? x? /? Base;

/*? Reduce first and then use? */?

* - p? =? Figure [oldx? -? x? *? base];

}? What time? ㈩;

/*? Negative plus sign? */

What if? (oldx? & lt? 0)? * - p? =? '-';

Return? p;

}