Question: #pragma once using namespace std; #include #ifndef Name _ H #define Name _ H class CommonName; class Name { private: int nextname; CommonName * NAMEPAIRS

#pragma once
using namespace std;
#include
#ifndef Name_H
#define Name_H
class CommonName;
class Name
{
private:
int nextname;
CommonName* NAMEPAIRS[1000]={ nullptr };
void findRecursive(string name, int low, int high)
{
}
public:
Name()// default constructor;
{
nextname =0;
}
void addName(CommonName* pair)
{
NAMEPAIRS[nextname]= pair;
nextname++;
}
void sortNames()
{
}
int findLinear(string name)
{
int found =-1;
int n =1000;
for (int i =0; i < n; i++)
{
if (NAMEPAIRS[i]->getName()== name)
{
found = i;
break;
}
}
return found;
}
int findBinary(string name)
{
}
};
class CommonName : public Name
{
private:
int ordinal;
string name;
public:
CommonName()
{
}
CommonName(int ord, string aName)
{
ordinal = ord;
name = aName;
}
int getOrdinal()
{
return ordinal;
}
string getName()
{
return name;
}
};
#endif
I am getting error use of undefined type CommonName on my find linear function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!