📄 common.c
字号:
#include <string.h>
unsigned long String2Hex(char *pstr)
{
int len = strlen(pstr);
unsigned long ulVal = 0;
unsigned char ucByte = 0;
int i = 0;
while(i < len)
{
ucByte = pstr[i];
if(ucByte >= '0' && ucByte <= '9')
ucByte -= '0';
else if(ucByte >= 'a' && ucByte <= 'f')
ucByte = ucByte - 'a' + 10;
else if(ucByte >= 'A' && ucByte <= 'F')
ucByte = ucByte - 'A' + 10;
else
break;
ulVal = ulVal << 4;
ulVal |= ucByte;
i++;
}
return ulVal;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -