- 博客(6)
- 资源 (3)
- 收藏
- 关注
原创 定长数据检查
bool_t CheckType(void) { bool_t result=true; // if( (uint8_t)0x100 != 0) { printf("uint8_t type error/n"); result=flase; } // 16 16 if(( (uint16_t)0x10000 != 0) || ((uint16_t)0xffff != 0xffff)) { printf("uint16_t type error/n");
2010-11-25 09:18:00
379
原创 无类型1
<br />//解决思路<br />//可能涉及到的问题<br />//1:如何判断一个字符串是数字还是别的类型.<br />//2:如何查找一个字符串中某个符号出现的次数.<br />//3:如何设置EDIT光标的位置.<br />//1 问题的解决方法可以利用下面的方法解决.<br />//CString strtemp = szTemp.SpanIncluding("0123456789");<br />//if (!strtemp.IsEmpty())<br />//这个字符串为数字<br />//
2010-11-25 08:43:00
276
原创 大小端模式判断
<br />int checkCPUendian()<br />{<br /> union<br /> {<br /> unsigned int a;<br /> unsigned char b;<br /> } c;<br /> c.a = 1;<br /> return (c.b == 1);<br />}<br />/* return 1 :little-endian,return 0 big-endian*/
2010-11-25 08:38:00
297
原创 时间函数
<br /><br /> <br />/方案— 优点:仅使用C标准库;缺点:只能精确到秒级<br />#include <time.h><br />#include <stdio.h><br />int main( void )<br />{<br />time_t t = time(0);<br />char tmp[64];<br />strftime( tmp, sizeof(tmp), "%Y/%m/%d %X %A 本年第%j天 %z",localtime(&t) );<br />puts( tm
2010-10-19 19:50:00
359
原创 删除自身的程序代码
#include #include #include #define Cleanse(x) { res == (x); goto __cleanse; }typedef BOOL (WINAPI *DELETEFILEA)(const char*);struct remove_data{ char filename[_MAX_PATH]; DELETEFILEA deleteFile;};DWORD WINAPI remove_code(LPVOID param){ struct remo
2010-10-18 23:01:00
495
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人