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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:41:26+00:00 2026-06-14T07:41:26+00:00

I am having some issues with code that is returning a pointer to a

  • 0

I am having some issues with code that is returning a pointer to a struct declared inside a class. Here is my code so far:

SortedList.h

#ifndef SORTEDLIST_H
#define SORTEDLIST_H

class SortedList{

 public:

    SortedList();

 ...

 private:

    struct Listnode {    

      Student *student;

      Listnode *next;

    };

    static Listnode *copyList (Listnode *L);

};

#endif

SortedList.cpp

#include "SortedList.h"

...

// Here is where the problem lies

Listnode SortedList::*copyList(Listnode *L)

{

    return 0; // for NULL

}

Apparently, the copy list method wont compile. I am using Microsoft Visual Studio and the compiler tells me that “Listnode” is unidentified. When I try to compile, here is whhat I get:

1>------ Build started: Project: Program3, Configuration: Debug Win32 ------

1>  SortedList.cpp

sortedlist.cpp(159): error C2657: ‘SortedList::*’ found at the start of a statement (did you forget to specify a type?)

sortedlist.cpp(159): error C4430: missing type specifier – int assumed. Note: C++ does not support default-int

sortedlist.cpp(159): error C2065: ‘L’ : undeclared identifier

sortedlist.cpp(159): error C4430: missing type specifier – int assumed. Note: C++ does not support default-int

sortedlist.cpp(159): fatal error C1903: unable to recover from previous error(s); stopping compilation

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Help would be greatly appreciated…ASAP

  • 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-14T07:41:27+00:00Added an answer on June 14, 2026 at 7:41 am

    Inside the cpp file, the function should be defined as:

    SortedList::Listnode* SortedList::copyList(ListNode* L)
    {
        return 0; //For NULL
    }
    

    Also, the struct Listnode should be declared either public or outside the class SortedList.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some issues with a code that is occasionally and sporadically throwing
I'm having some issues with some jQuery code, and I'm hoping and thinking that
Seem to be having some issues with executing jQuery code in the caption class.
I'm having some issues with my code. This is probably due to some design
I'm having some issues getting file uploads to work correctly and the following code
I am having some issues passing commands through to flash from javascript. My code
I am having some issues with logging. After reviewing JBoss Seam source code, I
I'm trying to convert some VB.net code into C# and having issues trying to
Originally, I was having some issues getting this code to function, but after a
I am having some issues with cudaGetDeviceCount returning zero if used in mpirun with

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.