STL bit_vector to a binary file
This is simple. HOW CAN I STORE A BIT_VECTOR ( from STL ) INTO A BINARY FILE ?? NOT the pointers of bit_vector. Of course, i want to be able to read the file and have again my bit_vector just as the original. For example: bit_vector x(500)
If someone really knows, please tell me. If it isn't possible i'll have to use an auxiliary array, isn't it ? i really need to do this thanks |
Just take every eight bits, put them together into a byte, and then write the byte. There's nothing special about a bit vector from other types of vectors (how would you "store" other types of vectors?).
|
All times are GMT -5. The time now is 01:09 PM. |