路过的大侠们进来帮忙解释一下加粗的那几句话,谢谢了
加粗的那几句话不能理解,帮忙解释下,谢谢了啊#include <iostream.h>
#include <string.h>
void convto(char *s,int n,int b)
{
char bit[] = {"0123456789ABCDEF"};
int len;
if(n == 0)
{
strcpy(s,"");
return;
}
convto(s,n/b,b);
len = strlen(s);
s[len] = bit[n%b];
s[len+1] = '\0';
}
void main()
{
char s[80];
int i,base,old;
cout << "请输入10进制数:";
cin >> old;
cout << "请输入转换的进制:";
cin >> base;
convto(s,old,base);
cout << s << endl;
cin.get();
}