Use operator << and >>

解决方案 »

  1.   

    把byte逐位赋给一个整型数组,再把该数组逐位赋给byte.
      

  2.   


    同意楼上的和楼下的。
    byte NegateValue(byte ainput)
    {
        byte retvalue=0;
        byte tmp;
        for(int j=0;j<8;j++)
        {
            tmp=ainput & (2^j);
            if(j<=3)
            tmp=tmp<<(7-j);
            else
            tmp=tmp>>(2 * j-7);
            retvalue=retvalue | tmp;
        }
        return retvalue;
    }
      

  3.   

    BYTE a,b;
    a=youedata;
    b=0;
    for(int i=0;i<8;i++)
    {
       b=(b<<1)|(a&0x01);
       a=a>>1;
    }
      

  4.   

    BYTE a,b;
    a=youedata;
    b=a&0x0f;
    a=(b<<4)|(a>>4)
      

  5.   

    //faint
    这么麻烦的方法也好意思写出来!!!
    #define BYTE_SWAP(b) (( b >> 4) | ((b & 0x0F) << 4) )
      

  6.   

    是我没搞清题意吗?
    是不是把 "abcdefgh"变成"hgfedcba"?
      

  7.   

    难道是把 "abcd efgh"变成"efgh abcd"???? 
      

  8.   


    beni() 的对了,我错了,我是人渣。noho(听,钱在说话) 也错了,输入1得16,嘿嘿,byte应该是8位。
      

  9.   

    这样行吗?
    BYTE bValue;
    short iHigh,iLow;
    // get the the value of the low
    iLow = bValue % 16;
    //get the value of the high
    iHigh =bValue - iLow
    BYTE newValue;
    newValue = iLow *16 + iHigh/16;
    OK!
      

  10.   

    to qin_wei(烤毛蛋) :
    你的方法我试了一下,题目
    “如00000011变成11000000”这个要求都没满足
      

  11.   

    to qin_wei(烤毛蛋) 
    我们是探讨问题,没必要用“人渣”这词