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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:17:04+00:00 2026-05-20T09:17:04+00:00

Ive looked all over and I cant find anything relating to my problem. Im

  • 0

Ive looked all over and I cant find anything relating to my problem. Im trying to write a class definition for a polygon class that basicly has a vector that holds pointers to a point. When I try to compile i keep geting the folllowing errors…

error C2143: syntax error : missing ‘;’ before ‘<‘
error C4430: missing type specifier – int assumed.
error C2238: unexpected token(s) preceding ‘;’
error C2061: syntax error : identifier ‘vector’
error C2065: ‘myPolygonPoints’ : undeclared identifier
error C2065: ‘points’ : undeclared identifier
error C2065: ‘myHasInstersection’ : undeclared identifier
error C2660: ‘Polygon::addSetOfPoints’ : function does not take 1 arguments

Here is the code to the class

#include "Point.h"
#include <vector>

class Point;

class Polygon
{
private:
    vector<Point*> myPolygonPoints;
    bool myHasIntersection;

public:
    void addSetOfPoints(vector<Point*> points)
    {
        myPolygonPoints = points;
    }

    bool getHasIntersection()
    {
        return myHasIntersection;
    }

    void setHasIntersection(bool intersection)
    {
        myHasInstersection = intersection;
    }

};
  • 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-20T09:17:05+00:00Added an answer on May 20, 2026 at 9:17 am

    You are using vector from the std namespace without qualifying it.

    You either have to do using namespace std;, or using std::vector, or declaring all your vector objects with the std namespace like std::vector.

    #include "Point.h"
    #include <vector>
    
    class Point; // Assuming Point.h has this declared,
                 // you don't need this forward declaration, but in reality,
                 // you don't need to include Point.h
                 // since you're only declaring pointers to Points
    
    class Polygon
    {
    private:
        std::vector<Point*> myPolygonPoints;
        bool myHasIntersection;
    
    public:
        void addSetOfPoints(std::vector<Point*> points)
        {
            myPolygonPoints = points;
        }
    
        bool getHasIntersection()
        {
            return myHasIntersection;
        }
    
        void setHasIntersection(bool intersection)
        {
            myHasInstersection = intersection;
        }
    
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've looked all over the place and cant find a solution that helps my
I've looked all over the SubSonic website, but I can't find anything about its
I've looked all over the internet and can't seem to find what i'm looking
I've looked all over the net and can't seem to find a standard way
I've looked all over the web and stackoverflow and can't find anyone talking about
So, I've looked all over the web for this simple answer...and I can't find
I've looked all over the place, but can't seem to find any easy to
I'm facing a weird problem. I looked around all over stackoverflow.com and elsewhere, but
I've looked all over for an answer to this, and I can't find any
I've looked all over and haven't been able to find a clear answer 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.