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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:48:35+00:00 2026-06-02T02:48:35+00:00

I have a point3 struct with 3 floats x y z (coordinates in 3-D

  • 0

I have a point3 struct with 3 floats x y z (coordinates in 3-D space).

I create a few instances of point3, and then create a list and push those instances onto the list. Then I apply a translation function to the entire list.

Question: After applying the translation, how can I print out the X coordinate of one of the points in the list to check if my translation function does what I want it to?

Here is my code:

int main()
{   
    point3 p1 = point3(0.0f, 0.0f, 0.0f);
    point3 p2 = point3(1.0f, 1.0f, 1.0f);
    point3 p3 = point3(2.0f, 2.0f, 2.0f);

    list<point3> myList;
    myList.push_front(p1);
    myList.push_front(p2);
    myList.push_front(p3);

    list<point3> myList2 = translateFact(myList, 1, 1, 1);

    std::cout << myList2.front.x; //<--- This is the line I'm having trouble with
}

//Translates the face by dx, dy, dz coordinates
list<point3> translateFact(list<point3> lop, float dx, float dy, float dz)
{
    list<point3>::iterator iter;

    for (iter = lop.begin() ; iter != lop.end(); iter++){
        point3 p = *iter;
        iter->x - dx;
        iter->y - dy;
        iter->z - dz;
    }
    return lop;
}

The error I receive when trying to print myList2.front.x is

IntelliSense: a pointer to a bound function may only be used to call the function

so I think my issue is related to pointers, but I am unsure how. I just picked up C++ recently so I don’t know enough about pointers to diagnose/fix the error.

  • 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-02T02:48:36+00:00Added an answer on June 2, 2026 at 2:48 am

    You need parentheses to indicate that you want to call the front method:

    std::cout << myList2.front().x;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a point3 struct that takes 3 floats x, y, z (3-D space
i have two points in 3D space which have X-coordinates with different signum. so
If you have an immutable type like this: struct Point3 { } and a
I have a class with property type of Point ( struct in .NET Framework).
I have a struct called Point. Point is pretty simple: struct Point { Row
I need to use IBM Informix for my project where I have point coordinates
I have two points in 3D space: a = (ax, ay, az) b =
I have 2d-points (x,y) with float coordinates, when I draw them, I need to
I have a std::vector that holds a Point struct (x,y,z and some other non-pointer
I have a few questions about boost::regex: I tried an example below. 1) What

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.