I am trying to make a library system using C++, where i would ask the user for input for book name, author, and year and it will be stored in a linked list. I have done the following so far in the header file (which seems to have no errors)
#include <iostream>
#include <string>
#include "LinkedList.h"
using namespace std;
class LinkedList {
private:
struct BookNode {
string Book_Title;
string Author_Name;
int Year_of_Publishing ;
BookNode* next;
};
public:
LinkedList();
void addInfo(string,string, int);
void print();
};
and for the .cpp
void LinkedList::addInfo(string data1,string data2, int data3)
{
BookNode* n = new BookNode;
n->Book_Title = data1;
n->Author_Name = data2;
n->Year_of_Publishing = data3;
n->next = NULL;
curr = head;
However, for this its giving the error
LinkedList::addInfo(<error-type>, <error-type>, int)
" (declared at line 27 of
What am i doing wrong?