C++ program that reads from file and performs bitwise operations
<p>I'm not asking for code I'm asking for help. yes it is for a project for class.</p>

<p>Program reads a .txt file that contains something like this,</p>

<ul>
<li>NOT 10100110</li>
<li>AND 00111101</li>
</ul>

<p>Program needs to read the operator and perform a function according to that operator to alter the byte. Then output the altered byte.</p>

<p>What I know how to do:</p>

<ul>
<li>Open the file up.</li>
<li>read from the file.</li>
<li>I can store the byte in an array.</li>
</ul>

<p>What I need help with: </p>

<ul>
<li>Reading the operator (AND, OR, NOT)</li>
<li>Store each bit inside an array (I can store the byte but not the bit)</li>
</ul>

<p>My code: </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;istream&gt;
#include &lt;cctype&gt;
#include &lt;cstdlib&gt;
#include &lt;string&gt;

using namespace std;

int main()
{
const int SIZE = 8;
int numbers[SIZE]; // C array? to hold our words we read in
int bit;

std::cout &lt;&lt; "Read from a file!" &lt;&lt; std::endl;

std::ifstream fin("small.txt");


for (int i = 0; (fin &gt;&gt; bit) &amp;&amp; (i &lt; SIZE); ++i) 
{                                            
cout &lt;&lt; "The number is: " &lt;&lt; bit &lt;&lt; endl;
numbers[i] = bit;

} 

fin.close();
return 0;
}
</code></pre>
