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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:49:07+00:00 2026-05-29T18:49:07+00:00

Ive been trying to get this solved for quite a few hours, but I

  • 0

Ive been trying to get this solved for quite a few hours, but I don’t know how to get around this. I have a list of values in a list container like the following:

[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

I have also created another list of pointers that point to every 4th element. So they point to the following:

[0,4,8,12]

I have a Method to return the end of the list of pointers. Like the following:

int*    end() {return *(pointerlist.end()) ;};

This gives me “Runtime Error: Assertion Failed, List Iterater not dereferencable”

I understand that I am recieving this error because I am attempting to reach beyond the end of the list of pointers, But I would Like the have the value of the last element in this list. I have tried doing the following as well, but it just makes things worse.

int*    end() {return *(pointerlist.end() - 1) ;};

Does anyone have any ideas how I can retrieve the last element in the list of pointers?

  • 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-29T18:49:17+00:00Added an answer on May 29, 2026 at 6:49 pm

    This should do it:

    int* end() {
        assert(!pointerlist.empty());
        return pointerlist.back();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

2 days I've been trying to get my head around this, but no joy.
I've been trying to get this problem solved, but I can't seem to figure
I've been trying to get this to work for quite a while now but
I've been trying to solve this problem for quite sometime but I am having
I've been trying to solve this problem for a couple of hours but I
I have been trying to get this to work for about three solid days
Ive been trying to get this sql statement to work properly through excel vba.
I've been trying to get this module to work and no matter what I've
I've been trying to get this Sudoku game working, and I am still failing
I've been trying to get an Gtk2::Image object in this Perl Gtk2 application to

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.