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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:16:26+00:00 2026-05-16T07:16:26+00:00

I am busy with an assignment an I am getting an error from the

  • 0

I am busy with an assignment an I am getting an error from the compiler. I’ve got 4 yrs C# experience nil in C++.

I’m getting the error “Invalid conversion from nodeType, initializing argument 1 of void linkedListType::deleteNode(const Type&) [with Type = int]’ ” on the line deleteNode(current->link); of this function:

template<class Type>
void linkedListType<Type>::deleteNodePosition(int position)
{
    nodeType<Type> *current; //pointer to traverse the list
    nodeType<Type> *trailCurrent; //pointer just before current

    if(first == NULL)    //Case 1; list is empty. 
        cerr<<"Can not delete from an empty list.\n";
    else
    {
        current = first;
        int counter = 0;

        while(current != NULL && counter <= position)
            {               
                trailCurrent = current;
                current = current->link;
                counter++;
            } // end while
        deleteNode(current->link);
    }

deleteNode is defined as :

template<class Type>
void linkedListType<Type>::deleteNode(const Type& deleteItem)
{
    .....

and nodeType is defined as:

struct nodeType
{
    Type info;
    nodeType<Type> *link;
};

and I am calling the offending function with this:

linkedListType<int> llist;
llist.insertFirst(99);
llist.insertLast(94);
llist.deleteNodePosition(2);

Please help?

  • 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-16T07:16:26+00:00Added an answer on May 16, 2026 at 7:16 am

    Well, the problem is pretty straightforward. This:

    current->link
    

    is defined to have type

    nodeType<Type>*
    

    But this function that you are trying to pass it to

    void linkedListType<Type>::deleteNode(const Type& deleteItem)
    

    accepts an argument of type

    const Type&
    

    Since nodeType<Type>* isn’t at all the same thing as const Type&, that function can’t accept that parameter.

    Without seeing the rest of your code it’s hard to infer what you meant to do, but I would think that based on its name, the deleteNode function should accept a node (i.e. a nodeType<Type>*) rather than a piece of data contained by a node.

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

Sidebar

Related Questions

I´m busy converting an existing project from an Ant build to one using Maven.
I am busy developing a chrome extension. What it will do: Get data from
I am busy working on a mobile application that retrieves data from a web
I am busy building an application in which I am reading data from more
I am busy getting values on a form using jQuery to send to my
I'm busy with an assignment but I'm stuck. I get errors and I don't
Busy working on Visual Studio 2010 Express for Windows phone and is wanting to
Im busy with my app and i walked in some problems when i click
I am busy creating a less complicated version of NinePatchDrawable that tiles the inner
I am busy writing an dynamic AND filter on a IQueryable Linq object, so

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.