Comp Sci Unfamiliar Compilation Errors In a Linked List Class (C++)

AI Thread Summary
The user is facing compilation errors in their "List.h" file while working on a linked list class for a final project. They have successfully compiled related classes like "Address.h", "Date.h", and "Person.h", but encounter an issue where their Node struct is implicitly deleted. The user requests assistance in resolving these errors without having to redo their previous work. Additionally, they mention difficulty in sharing the error messages due to the format of the attached image. The discussion emphasizes the need for clear communication of error details for effective troubleshooting.
rtareen
Messages
162
Reaction score
32
Homework Statement
This program will have names and addresses saved in a linked list. In addition, a birthday and anniversary date will be saved with each record. The linked list should be implemented as its own class.
Relevant Equations
none
Hi all. I'm working on my final project for a class. The assignment is to have a linked list of personal records, and then do some things with it. Right now I'm working on the linked list class "List.h". I've implemented a Person class "Person.h" as a composition of 3 subclasses "Address.h", "Date.h" and "Name.h". I've attached all of these as text files (I'm not allowed to attach .h files?). I'm able to compile "Address.h", "Date.h", "Name.h" and "Person.h" without any issues. But when I'm trying to compile "List.h" I get some serious compilation errors (attached). The most serious is the one that says my Node struct is implicitly deleted. I need some help on how to solve this without re-doing everything I've already done. Please help.
errors.jpg
 

Attachments

Physics news on Phys.org
My Address.txt file is not showing up so I'm pasting it here
Edit by moderator: Added code tags
C++:
include <iostream>
#include <string>
using std::cout;
using std::string;

class Address
{
    public:
        Address(int num = 0, string name = "Default Rd", int unit = 0, string town = "Deafult City", string _state = "AK", string zipCode = "00000")
        {
            setStreetNumber(num);
            setStreetName(name);
            setUnitNumber(unit);
            setCity(town);
            setState(_state);
            setZip(zipCode);
        }
        void setStreetNumber(int num)
        {
            if (num < 0)
            {
                cout << "Invalid street number. Setting to default value: 0.\n";
                streetNumber = 0;
            }
            else
                streetNumber = num;
        } 
        void setStreetName(string name)
        {
            streetName = name;
        }
        void setUnitNumber(int unit)
        {
            if (unit < 0)
            {
                cout << "Invalid unit number. Setting to default value: 0.\n";
                unitNumber = 0;
            }
            else
                unitNumber = unit;
        }
        void setCity(string town)
        {
            if(town.length() > 20)
            {
                town = town.substr(0,20);
                cout << "City name too large. Limiting to 20 characters.\n";
            }
            city = town;
        }
        void setState(string _state)
        {
            if(_state.length() != 2)
            {
                cout << "State must be 2 characters. Setting to default value: AK.\n";
                state = "AK";
            }
            else
            {
                for(int i = 0; i < 2; i++)
                    _state[ i] = toupper(_state[ i]);
                state = _state;
            }
        }
        void setZip(string zipCode)
        {
            if (zipCode.length() > 5)
            {
                cout << "Zip code too long. Limiting to 5 characters.\n";
                zipCode = zipCode.substr(0,5);
                zip = zipCode;
            }
            else if( zipCode.length() < 5)
            {
                cout << "Zip code too short. Setting to deafault value: 00000.\n";
                zip = "00000";
            }
            else
                zip = zipCode;
        }
        int getStreetNumber()
        {
            return streetNumber;
        }
        string getStreetName()
        {
            return streetName;
        }
        int getUnitNumber()
        {
            return unitNumber;
        }
        string getCity()
        {
            return city;
        }
      
        string getState()
        {
            return state;
        }
        string getZip()
        {
            return zip;
        }
  
    private:
        int streetNumber;
        string streetName;
        int unitNumber;
        string city;
        string state;
        string zip;
};
 
Last edited by a moderator:
rtareen said:
But when I'm trying to compile "List.h" I get some serious compilation errors (attached). The most serious is the one that says my Node struct is implicitly deleted.
Your attachment, errors.jpg, is impossible for me to read. I can barely read the lines with white text, but the lines that describe errors are red against a black background, which makes them impossible for me to read. Please copy the contents of the compiler output as text and post it directly, not as an image.
 

Similar threads

Replies
2
Views
2K
Replies
1
Views
10K
Replies
2
Views
4K
Replies
12
Views
2K
Replies
22
Views
3K
Replies
2
Views
2K
Replies
15
Views
2K
Replies
1
Views
2K
Replies
5
Views
2K
Replies
5
Views
2K
Back
Top