I'm not asking for code I'm asking for help. yes it is for a project for class.
Program reads a .txt file that contains something like this,
* NOT 10100110
* AND 00111101
Program needs to read the operator and perform a function according to that operator to alter the byte. Then output the altered byte.
What I know how to do:
* Open the file up.
* read from the file.
* I can store the byte in an array.
What I need help with:
* Reading the operator (AND, OR, NOT)
* Store each bit inside an array (I can store the byte but not the bit)
using namespace std;
const int SIZE = 8;
int numbers[SIZE]; // C array? to hold our words we read in
std::cout << "Read from a file!" << std::endl;
for (int i = 0; (fin >> bit) && (i < SIZE); ++i)
cout << "The number is: " << bit << endl;
numbers[i] = bit;