Parent Directory
|
Revision Log
|
Revision Graph
Standard incs that need to be there these days.
1 | #include <string.h> |
2 | char *base36(n) |
3 | /* Returns a character string representing an integer in base 36 */ |
4 | int n; |
5 | { |
6 | char *base = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
7 | int i, l; |
8 | char buffer,num[500]; |
9 | static char rev[500]; |
10 | i = strlen(base); |
11 | l=0; |
12 | while ( n > i-1 ) { |
13 | num[l]=base[n-i*(n/i)]; |
14 | ++l; |
15 | n = n/i; |
16 | } |
17 | num[l]=base[n]; |
18 | rev[l+1]='\0'; |
19 | for (i=0;l>=0;--l){ |
20 | rev[i]=num[l]; |
21 | ++i; |
22 | } |
23 | return(rev); |
24 | } |
25 |
ViewVC Help | |
Powered by ViewVC 1.1.22 |