I was wondering why the compiler keeps telling me
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <string>
using namespace std;
const int PatternSize = 8;
typedef int OperandArray[PatternSize];
// the major data structure, the BitPattern class
class BitPattern
{
public:
// default constructor, sets all bits to zero
BitPattern ();
// IO routines
void ReadBitPattern (ifstream& infile);
void PrintBitPattern () const;
// bit manipulation functions on one bit pattern
// these all modify the calling object and print result internally
void Operation_NOT ();
void Operation_CONVERT ();
void Operation_LSHIFT (int);
void Operation_RSHIFT (int);
// bit manipulation functions on two bit patterns
// these all return an anonymous object as a result and do not print result
const BitPattern Operation_AND (const BitPattern&) const;
const BitPattern Operation_OR (const BitPattern&) const;
const BitPattern Operation_ADD (const BitPattern&, bool&) const;
private:
OperandArray bitArray; // the array of 1s and 0s representing bits
int BinaryExp (int); // a helper function to calculate powers of 2
};
void ReadBitPattern (ifstream& infile)
{
char ch;
if(ch == '0')
{
for (int index = 0; index < PatternSize; index++)
{
cin.get (ch);
}
}
else
{
for (int index = 0; index < PatternSize; index++)
{
}
}
}
void Operation_NOT ()
{
}
void Operation_CONVERT ()
{
}
void Operation_LSHIFT (int)
{
}
void Operation_RSHIFT (int)
{
}
int main()
{
string operation;
fstream getfile;
do
{
cout << "Enter the input file name [no blanks!]:";
getline(cin,operation);
getfile.open(operation.c_str(),ios::in);
if (!getfile.is_open())
cout << "ERROR - file did not open." << "Please try again" << endl;
}while(!getfile.is_open());
while(!getfile.eof())
{
cin >> operation;
if (operation == "NOT")
{
BitPattern ReadBitPattern;
}
else if (operation == "AND")
{
}
else if (operation == "OR")
{}
else if (operation == "CONVERT")
{}
else if (operation == "L_SHIFT")
{}
else if (operation == "R_SHIFT")
{}
else
{}
}
return 0;
}
"Undefined symbols:
BitPattern::BitPattern(), referenced from:"
Because I thought I mentioned the Class properly.`