I am getting following Error. I tried all types of typecasting but no help. Please let me know what is going on here.
Error: Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?)
byte[] bitVector = new byte[UInt32.MaxValue/8];
//bitVector[((UInt32)x/8)] |= (1 << ((int)(x % 8))); ERROR
//bitVector[((UInt32)x / 8)] |= (1 << Convert.ToByte(x % 8)); ERROR
bitVector[((UInt32)x/8)] |= (1 << 5); //No Error