i want to change the a to the mask. How can I do that? The code is wrong in the bolded line.Code:#include<stdio.h> #include<limits.h> int main() { unsigned char a=0; int i=0; int masca[]={0,0,1,1,1,0,0,1}; for(i=CHAR_BIT-1;i>=0;i--) { (a>>i)=(a>>i)|(masca[8-i]); } for(i=CHAR_BIT-1;i>=0;i--) printf("%d",(a>>i)&1); printf("\n"); return 0; }
Thank you!