Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

itoa.cpp

Go to the documentation of this file.
00001 /*
00002 Implements the itoa function for Linux as it lacks it's own
00003 Check itoa.h for more detailed usage information
00004 */
00005 static char *_itoa(unsigned i, char *a, unsigned r)
00006 {
00007         if (i/r > 0) a = _itoa(i/r,a,r);
00008         *a =
00009 "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i%r];
00010         return a+1;
00011 }
00012 
00013 char *itoa(int i, char *a, int r)
00014 {
00015         r = ((r < 2) || (r > 36)) ? 10 : r;
00016         if (i < 0)
00017         {
00018                 *a = '-';
00019                 *_itoa(-i,a+1,r) = 0;
00020         }
00021         else *_itoa(i,a,r) = 0;
00022         return a;
00023 }
00024 

Generated on Fri Dec 5 04:05:59 2003 for Borqueror by doxygen 1.3.3