added utos_test.cpp

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-07-21 19:23:43 +08:00
parent b319a33d00
commit 4bc6cf4ef0
2 changed files with 30 additions and 0 deletions

View File

@ -30,6 +30,9 @@ cm_example_project("DataType" SplitStringTest)
add_executable(StrChrTest datatype/strchr_test.cpp)
cm_example_project("DataType" StrChrTest)
add_executable(Uint2StrTest datatype/utos_test.cpp)
cm_example_project("DataType" Uint2StrTest)
add_executable(MapTest datatype/MapTest.cpp)
cm_example_project("DataType" MapTest)

27
datatype/utos_test.cpp Normal file
View File

@ -0,0 +1,27 @@
#include<iostream>
#include<stdlib.h>
#include<hgl/type/StrChar.h>
using namespace std;
using namespace hgl;
int main(int,char **)
{
srand(time(nullptr));
long int rr=rand();
char str[64];
for(uint i=2;i<=26+10;i++)
{
utos( str, //输出字符串
64, //输出字符串缓冲区长度
rr, //要转换的数值
i); //进制
cout<<i<<":"<<str<<endl;
}
return 0;
}