search
尋找貓咪~QQ 地點 桃園市桃園區 Taoyuan , Taoyuan

純C 位元移動運算實現2次方運算+簡易家法[C_Byte_setBit] – jashliao部落格

純C 位元移動運算實現2次方運算+簡易家法[C_Byte_setBit]


GITHUB: https://github.com/jash-git/C_Byte_setBit


#include 
#include 

unsigned char C_Byte_setBit(unsigned char data,int num)
{//²¾°Ê¦¸¼Æ(1,2,3,4,5,6,7,8)¹ïÀ³ªº­È=1,2,4,8,16,32,64,128
    unsigned char d=1;//2^0
    if(num>0)
    {
        d=d<1
    printf("%d\n", d);
    d=C_Byte_setBit(d,2);//out->3
    printf("%d\n", d);
    return 0;
}



熱門推薦

本文由 jashliaoeuwordpress 提供 原文連結

寵物協尋 相信 終究能找到回家的路
寫了7763篇文章,獲得2次喜歡
留言回覆
回覆
精彩推薦