The task is really not formulated in great detail, but, in principle, it is possible to guess.
The bit string is not the most successful tracing from the widely used term bitfield
. For more understanding, I recommend to get acquainted with this reference here and, for example, with std :: bitset.
Determine whether you have questions in general setting of the assignment, and if so, it is necessary to deal with each item separately.
- Determine the class of the specified type.
- Write defined as user-friendly functions of the keyboard input and display routine of data defining objects of this class.
- Overload the specified operations and functions with the help of complex class functions.
- Define constructors and destructor.
Now a little more about the operations that you need to implement (in addition to the operator<<
and operator>>
, implicitly indicated in paragraph 2 of the previous part).
Here, obviously, you are asked to enter some strict ordering on a set of bit strings. The task is poorly formulated, since you can come up with a sufficient number of such relationships and they are not reflected in the text of the task. It is possible that (taking into account the next part of the task) it is enough just to implement a comparison of the corresponding numbers.
long abs()
- "value of the number specified by the bit string"
Presumably, here you need to get a number that is in its binary form and written in your string. That is, say, the bit string 11001
will correspond to the number 25
.