阅读背景:

c++如何使用指针指向循环移位数组元素

来源:互联网 
#include <iostream>
using namespace std;

void RotateLeft(unsigned char* in)
{
    unsigned int* q= (unsigned int*)in;
    *q = (*q >> 8)|((*q & 0xff) << 24);
}
int main() {
    unsigned char temp[4] = {'a', 'b', 'c', 'd'};
    RotateLeft(temp);
    for (int i=0; i<4; i++) {
        cout<<temp[i]<<endl;
    }
}
#include <iostream>
using namespace std;

void 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: