Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6319041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:44:06+00:00 2026-05-24T15:44:06+00:00

I am trying to build a Linked list application using C++ programming language &

  • 0

I am trying to build a Linked list application using C++ programming language & features such as inheritance etc.

I have split the interface & implementation in different files but not able to compile.

Below are the list of files

Interface files :- node.h , abstractList.h , singleLinkedList.h

Implementation files: singleLinkedList.cpp

node.h

#ifndef NODE_H
#define NODE_H

#include <iostream>

struct nodeType {
        int data;
        struct nodeType *next;
}listNode;


#endif

abstractList.h

#ifndef ABSTRACT_LIST_H
#define ABSTRACT_LIST_H

#include <iostream>
#include "node.h"
#include "singleLinkedList.h"

class abstractList {
        public:
        virtual ~abstractList();
        virtual bool isEmpty(Node* ) = 0;
        virtual int get(const int&) = 0;
        virtual int indexOf(const int& ) = 0;
        virtual Node insert(const int& , const int& ) = 0;
        virtual void delete(const int& ) = 0;
};

#endif

singleLinkedList.h

#ifndef SINGLE_LIST_H
#define SINGLE_LIST_H

#include <iostream>
#include "node.h"
#include "abstractList.h"

class singleLinkedList : public abstractList {

        public:

        singleLinkedList();
        ~singleLinkedList();
        Node populateList( );

        private:

        void checkIndex();
        int data;
        Node head;
};

#endif

So far i have just coded the populateList() function in the implentation file, here goes the implementation file.

singleLinkedList.cpp

#include <iostream>
#include "node.h"
#include "singleLinkedList.h"
#include "abstractList.h"


    Node singleLinkedList :: populateList()
    {
            Node temp;
            int data;
            temp = head;
            char ch;
            std::cout<<"Enter Data? (y/n) " << std::endl;
            std::cin>>ch;

            while(ch == 'Y' || ch == 'y')
            {
                    std::cout<<"Enter the data that you would like to store.\n"<<std::endl;
                    std::cin>>data;
                    temp = new Node();
                    temp->data = data;
                    temp->next = head;
                    head = temp;
                    std::cout<<"Enter more data?"<<std::endl;
                    std::cin>>"\n">>ch;
            }

            return temp;
    }

When i give g++ -c singleLinkedList.cpp , i am getting lot of errors. I am pretty sure i have done something stupid. Can anyone please pin point my error?

EDIT: Error Log With specfic issues.

struct nodeType {
int data;
struct nodeType *next;
}listNode;

virtual listNode *insert();

Is the above statement correct?

Thanks
Kelly

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:44:07+00:00Added an answer on May 24, 2026 at 3:44 pm

    delete is a keyword in C++, you can’t use it as a method name. You need to use a different name here:

    class abstractList {
            public:
            //...
            virtual void delete(const int& ) = 0;
            //-----------^^^^^^ rename this.
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a string using data elements stored in a std::list, where
I am trying to build my own implementation of a linked list in C++.
Trying to build a GUI application in Java/Swing. I'm mainly used to painting GUIs
I am trying to build an Eclipse application that would work with a linux/motif
I am trying to build the Intellesoft BugTrap source using Visual Studio 2008. I
I'm trying to build a C++ extension for python using swig. I've followed the
I am trying to build query in Play framework, I have select * from
I am trying to build a project using TFS2010 Build.TFS resides on its own
I am trying to add TCMPortMapper (http://code.google.com/p/tcmportmapper/) I have linked the framework in the
im trying to build a application or a method that goes through all of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.