suncica2222 0 Junior Poster

I want to copy one bitstream to another but it snaps in runtime

assert error subscript out of range window pops up

how to fix it?

see the code:

#include <iostream>
#include <fstream>

#include "boost\dynamic_bitset.hpp"


typedef boost::dynamic_bitset<unsigned char> Bitset;
typedef std::vector<Bitset> byteArray;

int main()
{

	Bitset bitset, bitset2,b3,b4;
	bitset =  Bitset(pPocetak,&pPocetak[brBajtova]);//this is ok

	bitset2.resize(100000,false);
	for(int i=0; i<=bitset.size(); i++)
	{
         bitset2[i] = bitset[i];// WHY IT SNAPS HERE????
	}
	return 0;

}