Question
i was trying to test the pair class but i keep getting this error. there arent any error when i just put everything in one
i was trying to test the pair class but i keep getting this error.
there arent any error when i just put everything in one cpp file.
ld: symbol(s) not found for architecture x86_64
#include
#include "Pair.h"
#include "LinkList.h"
int main()
{
Pair
q.setFirst(10);
q.setSecond(1.11);
std::cout<< q.getFirst() << std::endl << q.getSecond();
return 0;
}
#ifndef PAIR_H_
#define PAIR_H_
template
class Pair{
public:
Pair(F,S);
F getFirst();
S getSecond();
void setFirst(F);
void setSecond(S);
private:
F first;
S second;
};
#endif /* PAIR_H_ */
#include "Pair.h"
template
Pair
{
this-> first = first;
this-> second = second;
}
template
F Pair
{
return this->first;
}
template
S Pair
{
return this->second;
}
template
void Pair
{
this->first = first;
}
template
void Pair
{
this->second = second;
}
#ifndef LINKLIST_H_
#define LINKLIST_H_
template
class Node{
public:
void setNode(T node)
{
this->node = node;
};
void setLast()
{
this->node = '\0';
};
void setNext(Node * next)
{
this->node = next;
};
Node getNode()
{
return this->node;
};
private:
Node* node;
};
template
class LinkList{
public:
void addFront(T);
void addRear(T);
void insert(Node
void dele(Node
T find(Node
LinkList(T);
private:
Node
Node
};
#endif /* LINKLIST_H_ */
#include "LinkList.h"
template
LinkList
{
this->head = '/0';
this->next = '/0';
}
template
void LinkList
{
if(head == '/0')
{
head = new Node
head->setNode(obj);
next = head;
}
else
{
Node
temp->setNode(obj);
temp->setLast();
next->setNext(temp);
next = next->getNode();
}
}
template
void LinkList
{
if(head == '/0')
{
head = new Node
head->setNode(obj);
next = head;
}
else
{
Node
temp->setNode(obj);
temp->setLast(head);
head = temp;
}
}
template
void LinkList
{
Node
temp->setNode(obj);
temp->setNext(node->getNode());
node->setNext(temp);
}
template
void LinkList
{
Node
temp = head;
while(temp->getNode() != node && temp->getNode())
{
temp = temp->getNode;
}
if(temp)
{
temp->setNext(node->getNode());
delete node;
}
}
template
T LinkList
{
int size = 0;
Node
temp = head;
while(temp)
{
size++;
temp = temp->getNode();
}
return size;
}
heres my code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started