写程序:读出二进制流中指定的几位
写程序:读出二进制流中指定的几位
为了方便,二进制流放在字符串中,"1122335566"
unsigned int GetBits(wstring str, unsigned int pos, unsigned int len)
{
}
wstring s("1122335566");
cout < < Hex < < GetBits(s, 12, 8) < < endl;//输出23
求达人如何写这个函数
[解决办法]
先读出Byte单位的数据,然后通过位操作得到自己想要的值。
[解决办法]
二进制流放在字符串中,"1122335566"
二进制怎么会有2 3 5 6呢?
1122335566"
意思是把存入的二进制提取并存入 字符串后显示的结果吗?