This program convert the binary string back to the ASCII format. In case there is no ASCII counter part, it just prints the hexadecimal value of the character. A data file: zeros_and_ones.txt is given in the EXAM folder. Your program should at least be able to decode it back to plain text.

A program take the binary string from keyboard entry
A program read in the binary digits from a file and print its contents in ASCII
A program that reads in the binary digits from a file, convert it to ASCII characters, and write it out into anther file.

Code:
// Project3.cpp 
//

#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;

void converByte(char byte[]);
void converFile(char line_read[]);

int _tmain(int argc, _TCHAR* argv[])
{
	char dummy;
	char line_read[1000];
	char byte[8];

	ifstream infile;

	infile.open("C:/zeros_and_ones.txt", ios::in);
	infile.getline(line_read, 1000);

	cout << "Read from the file: " << line_read << endl;

	convertFile(line_read);

	ofstream outfile("F:/*** 6/write.txt");
	cout << endl;
	cout << "Has been written to the file: \" F:/*** 6/write.txt\" " << endl;

	cin.ignore();
	cin >> dummy;

}
void converByte(char byte[])
{
	int q;

	int byte_decimal_value = 0;
	int weight = 128;
	for(q = 0; q < 9; q++)
	{
		if(byte[q] == '1') byte_decimal_value = byte_decimal_value + weight;
		weight = weight/2;
	}

	cout << (char) byte_decimal_value << " ";

}

void convertFile(char list_file[])
{
	int a, b;
	int num_bytes;
	num_bytes = strlen(list_file)/8;
	char byte[8];
	for(b = 0; b <= num_bytes; b++)
	{
		for(a = 0; a < 8; a++)
		{
			byte[a] = list_file[a + b*8];
		}
		converByte(byte);
	}
return;
}

What am I doing wrong?