how can i resolve this fatal error C1083: Cannot open include file: 'interface.h': No such file or directory

my is interface.h


using namespace std;

struct DataType {
int key;
string name;
};

struct Node {
DataType dataIn; // the actual data goes in here
Node *link; // link to the next node in the linked list
};

class LList
{
int count;
Node *rear;
Node *top;

public:
LList();
~LList();

bool InsertLList(DataType dataIn);
bool display();
void freeLLmemory();
};

#include "implement"

my implement.h is
LList::LList()
{
count=0;
rear = Null;
top=Null;
}
LList::~LList()
{
freeLLmemory();
count=0;
top = rear = Null;
}

// function for inserting information into the linked list: inserts at the // end of the linked list

bool LList::InsertLList(DataType dataIn)
{
Node *temp;

temp = new(nothrow)Node; // allocate space for a new
// node and store its address in temp

temp->data = dataIn; // copy the data over into
// the new node
temp->link = NULL; // and this new node is
// not pointing at any other node

// is the linked list empty?
if(top == NULL) {
// if so this new node is the first node into the linked list
top = temp;
rear = temp;
}else { // else already
// have some nodes in the linked list
rear->link = temp; // the last node; link
// it to the new node
rear = temp; // now make this new
// node the last node
}

count++; // shows that we have added one more node

}

// function to display the items on the list
bool LList::displayLList();
{

Node *temp = top; // gets the address of the first item on
// the list
if (temp == NULL)
cout << "\nThe Linked List is empty...\n";
else {
while(temp!= NULL) {
cout << "Key: " << temp->key << " Name: " << temp->name
<< "\n";
temp = temp->link;
}
cout << endl;
}
}
bool LList::removeItem(int keyIn)
{
Node *nodeOut; // will contain address of the node to remove

bool retFlag;
char resp;

retFlag = searchLList(nodeOut,keyIn);
if(retFlag == true) { // we were able to find the node
cout << "Key: " << nodeOut->key << " Name: " << nodeOut->name
<< "\n";
cout << "\n\nDo you really want to remove this node? (Y/N): ";
cin >> resp;
//--- delete node -----

}


// free the memory held up by the linked list

void LList::freeLLMemory()
{

Node *temp = top; // gets the address of the first item on
// the list

while(top != NULL) {
temp = temp->link;
delete top;
top = temp;
}
}

my main function is

#include "stdafx.h"
#include <iostream>
#include <string>
#include <new>
#include <interface.h>

void main()
{
LList myLList();

DataType dataIn;

dataIn.key = 100;
dataIn.name = "Nkhata";

myLList.InsertLList(dataIn);
myLList.displayLList();
}

i get : fatal error C1083: Cannot open include file: 'interface.h': No such file or directory
please use the tags....

do you have the interface.h in the same directory as the main cpp file ?

also you have #include "implement"
and I think there should be implement.h or .cpp
Last edited on
Topic archived. No new replies allowed.