bit arrays

Hi,

I'm trying to write this program where there is:
(1) a greeting
(2) make columns
(3) have a stored text file input into the program automatically
The file is like so:
NOT 11010011
AND 10010010
etc.
(4) read the first word and then output it
(5) read the first binary number pattern and output it


Thusfar I have made (1) and (2) and (3), but I'm having difficulties with (4). I tried searching online, but all I come across is getline in bit format.

would I do

#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;

int main ()
{
char CONVERT [7];
string fileNAME;

greeting ();

cout << setw(10) << "COMMAND" << "Operand #1" << "Operand #2" << "Shift" << "Result" << endl;
cout << setfill('-') << setw(50) << "-" << endl;

ifstream inFILE;
cout << "Please enter file name:";
cin >> fileName;
inFile.open (fileName.c_str()):

getline (CONVERT,7)

return 0;
}
closed account (zb0S216C)
(1) a greeting
(2) make columns
(3) have a stored text file input into the program automatically
The file is like so:
NOT 11010011
AND 10010010
etc.
(4) read the first word and then output it
(5) read the first binary number pattern and output it

You need to be more specific.

using namespace std;

Only pick out the parts you need from the standard namespace.

getline (CONVERT,7)

If you use this line, where will your null escape sequence go? Change the 7 to a 6.
Last edited on
Topic archived. No new replies allowed.