added utos_test.cpp
This commit is contained in:
parent
b319a33d00
commit
4bc6cf4ef0
@ -30,6 +30,9 @@ cm_example_project("DataType" SplitStringTest)
|
|||||||
add_executable(StrChrTest datatype/strchr_test.cpp)
|
add_executable(StrChrTest datatype/strchr_test.cpp)
|
||||||
cm_example_project("DataType" StrChrTest)
|
cm_example_project("DataType" StrChrTest)
|
||||||
|
|
||||||
|
add_executable(Uint2StrTest datatype/utos_test.cpp)
|
||||||
|
cm_example_project("DataType" Uint2StrTest)
|
||||||
|
|
||||||
add_executable(MapTest datatype/MapTest.cpp)
|
add_executable(MapTest datatype/MapTest.cpp)
|
||||||
cm_example_project("DataType" MapTest)
|
cm_example_project("DataType" MapTest)
|
||||||
|
|
||||||
|
27
datatype/utos_test.cpp
Normal file
27
datatype/utos_test.cpp
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user