摘要: string int2hexStr(int n) { char s[8] = { 0 }; itoa(n, s, 16); return s; } string binStr2hexStr(const string& src) { int len = src.length(); string tmp 阅读全文
posted @ 2020-12-17 16:20 巨龙岂是池中物 阅读(99) 评论(0) 推荐(0)
摘要: 1 char* myitoa(int val, char* buf, int radix) 2 { 3 int seed = radix-1; 4 int move = 2; 5 switch (radix) 6 { 7 case 2: 8 move = 1; break; 9 case 8: 10 阅读全文
posted @ 2020-12-17 14:01 巨龙岂是池中物 阅读(89) 评论(0) 推荐(0)
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using System.IO; 7 nam 阅读全文
posted @ 2018-05-14 16:52 巨龙岂是池中物 阅读(884) 评论(0) 推荐(0)
摘要: char* GetDoubleStr(double value) { char buf[32]={0};//长度可以自定义 sprintf(buf,"%.8f",value);//保留8位小数,不够补0 int index = 0; int len = strlen(buf); for(int i = len-1;i>0;i--) { if(buf[i] == '0') c... 阅读全文
posted @ 2016-12-02 17:40 巨龙岂是池中物 阅读(2189) 评论(0) 推荐(0)