Answer to Question #19304 in C++ for ayesha
The BitArray class
Here are some details about the BitArray class:
1. A bit array or binary number is to be implemented with an underlying array of type unsigned char. 'Unsigned' because we are only interested in bits, not in negatives, and type char because it is the smallest integer type. The concept of a BitArray object is that it will store an array of bits indexed at 0, just like normal arrays. The most significant bit represents the sign of the binary number.
2. The array of characters should be created dynamically. The primary constructor has one parameter, which indicates how many bits are needed.
3. The Length() function should return the total number of bits in the allocated array.
Submit it with all requirements as an assignment to our control panel and we'll assist you.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!