Link to home
Start Free TrialLog in
Avatar of dpms
dpms

asked on

Undeclared Identifier - Part 2

Okay the last one was a stupid spelling oversight. But I can't see why I get a "undeclared identifier" error everytime  I use the instance of the class as an arguement. The code snippet follows:

class CIntegerSet
{
public:
CIntegerSet (int,int,int,int,int);
CIntegerSet ();
void UnionOfIntegerSets                         (CIntegerSet &, CIntegerSet &);
CIntegerSet IntersectionOfIntegerSet (CIntegerSet &, CIntegerSet &);
void InsertElement (CIntegerSet &, int);
void DeleteElement (CIntegerSet &, int);
void SetPrint         (CIntegerSet &);
bool IsEqual         (CIntegerSet &, CIntegerSet &);
private:
      int IntArray[100];
};

int main ()
{

CIntegerSet IntSet1(4, 9, 21, 13, 44);
CIntegerSet IntSet2(3, 7, 33, 62, 75);
CIntegerSet IntSet3();

UnionOfIntegerSets(IntSet1, IntSet2);  // error HERE

SetPrint(IntSet3); //error HERE

InsertElement(IntSet1, 15);  //error HERE
InsertElement(IntSet2, 15);   // funny, no error here
ASKER CERTIFIED SOLUTION
Avatar of vsinha
vsinha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of larockd
larockd

The compiler is also going to bark about your constructor...  
Once you fix your other compile errors your constructor is going to cause an error.
CIntegerSet (int,int,int,int,int); This will produce an unresolved identifer LNK 1120 error..

Above is how you declare it....  Needs to be declared like this
CIntegerSet (int,int,int,int,int) {};

Plus you might actually want to do something in the constructor also...

Darrell