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 9309801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:57:28+00:00 2026-06-19T00:57:28+00:00

Related to C++ Basics. I am creating a singly linked list. class Linked_List {

  • 0

Related to C++ Basics.
I am creating a singly linked list.

class Linked_List
{
public: Linked_List();
    ~Linked_List();
        //Member Functions
    struct node* getHead(void);
private:
    struct node{
        int d;
        struct node* next;
    }*head;
};
struct node (Linked_List::*getHead)(void)
{
    return head;
}

I am getting this error:

“error C2470: ‘getHead’ : looks like a function definition, but there is no parameter list; skipping apparent body”.

I tried to search in google but of no use. Any suggestions plz.

  • 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-06-19T00:57:30+00:00Added an answer on June 19, 2026 at 12:57 am

    You don’t need a pointer to member function, you just want to provide a definition for that function:

    Linked_List::node* Linked_List::getHead()
    { 
        return head;
    }
    

    Also notice, that the struct keyword is unnecessary in the function definition, while you have to qualify the name of the struct node with the name of the class in the scope of which it is defined.

    Also, the void keyword to specify an empty argument list is unnecessary. I therefore suggest you to rewrite the class definition as follows:

    class Linked_List
    {
    private:
        struct node
        {
            int d;
            struct node* next;
        };
        node *head;
    public:
        Linked_List();
        ~Linked_List();
        node* getHead();
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

They're both resizable arrays, and std::basic_string doesn't have any specifically character-related functions like upper().
Related: How can I use polymorphism in XML Serialization? I have a class I
I am creating an application that tracks some specific performance-related statistics from SQL Server
I have very basic question related to tablespaces. When I was creating a user,
I have some parent/child relationships as follows: public class Card { public virtual int
I have two basic interface-related concepts that I need to have a better understanding
I have a number of tables containing some basic (business related) mapping data. What's
This is a basic understanding concepts related question. Working using: Embarcadero C++ Builder What
I am building some basic HTML code for a CMS. One of the page-related
Related: Cannot view exceptions thrown during Tomcat startup from Eclipse I have Eclipse setup

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.