Re: Dynamic array 80 80

Snippets out of context don't receive real answers.

Re: Dynamic array 80 80

What you mean. Is the not enough details there.

Re: Dynamic array 80 80

I can't compile your previous code and run it. If you could actually post the current code that demonstrates the issue you are facing, it would expedite the most correct answer.

Re: Dynamic array 80 80

Ok, here's the full code.

#include <iostream>
#include <fstream>
#include <limits>
#include <bitset>

using namespace std ;

int main()
{
	ofstream filebin ;
	filebin.open("RecordBinaryData.txt") ;

	ifstream file ( "path to binary file" ) ; 
	file >> noskipws ;
	typedef bitset< numeric_limits<unsigned char>::digits > bitset ;
        unsigned char byte ;
	long count = 0 ;
	
	if(filebin.is_open())
	{
		while( file >> byte )
		{
			//cout << bitset(byte) ; // to print bits as it is
			filebin << bitset(byte) ;
			count ++ ;
		}
		const long const_count = count ;
		long arr[const_count] ;

		filebin.close() ;
	}

	else
	{
		cout << "Unable to open the file.\n" ;
	}

cin.get() ;
return 0 ;
}

I have attached the binary file as well.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.