void SetBitPattern(unsigned int& V, const char* pattern, int startBitIndex){ int len; for(len = 0 ; pattern[len] ; len++); for(len = (startBitIndex + len - 1) ; *pattern ; V = (*pattern - '0' ? (V | (1<<len)) : (V & ~(1<<len))), pattern++ , len--); }
No comments:
Post a Comment