首页 > 代码库 > C++ unsigned long 转化为 unsigned char*
C++ unsigned long 转化为 unsigned char*
C++ Code
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
unsigned long lFileLen = 1000;
unsigned char *ucFileLenFlag; ucFileLenFlag = (unsigned char *) &lFileLen; //方法一 //方法二: ucFileLenFlag = new unsigned char [4];//数组指针 ucFileLenFlag[3] = ((unsigned char *)&lFileLen)[3]; //取i(long)最高位 ucFileLenFlag[2] = ((unsigned char *)&lFileLen)[2]; ucFileLenFlag[1] = ((unsigned char *)&lFileLen)[1]; ucFileLenFlag[0] = ((unsigned char *)&lFileLen)[0]; //取i(long)最低位 |
C++ unsigned long 转化为 unsigned char*
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。