2021年3月20日星期六

No instance of function template

I keep receiving the error No instance of function template and not sure why. The error comes up for line PersonNode* getNext() {

return next;  

}

Here's my code below: Header file

using namespace std;  class PersonNode  {    private:      string fName, lName, address, phone;      PersonNode* next;    public:      PersonNode();      PersonNode(string fName, string lName, string address, string phone);      string getAddress();      string getFName();      string getFullName();      string getLName();      PersonNode* getNext();      string getPhone();      void setAddress(string Address);      void setFName(string FName);      void setLName(string LName);      void setNext(PersonNode* Next);      void setPhone(string Phone);  };  

cpp file

#include "PersonNode.h"  PersonNode::PersonNode(string FName, string LName, string Address, string Phone) {      fName = FName;      lName = LName;      address = address;      phone = phone;      next = NULL;  }    PersonNode::PersonNode() {      next = NULL;  }    PersonNode* getNext() {        return next;  }    void PersonNode::setNext(PersonNode *Next)  {      next = Next;  }  
https://stackoverflow.com/questions/66728755/no-instance-of-function-template March 21, 2021 at 12:07PM

没有评论:

发表评论