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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:09:23+00:00 2026-05-31T20:09:23+00:00

I am building three classes, Maze, MazeRow, and MazePoints, to hold a maze structures

  • 0

I am building three classes, Maze, MazeRow, and MazePoints, to hold a maze structures and I am having trouble with setting up my vector for the MazeRows.The below code is from my Maze class code. I have included my header file for MazeRow. I am getting 3 errors each where i am calling a vector method. Also myMazeRows is a private member variable of Maze Class

//Maze Header File    
#include "MazeRow.h"
#include <vector>
using namespace std;
namespace MazeSolver
{

class Maze
    {
    public:
        Maze(int rows, int columns);
        MazeRow *      getRow(int row);
            private:
                    vector<MazeRow> myMazeRows();

 //Maze Implementation File
 #include "stdafx.h"
 #include "Maze.h"
 #include <vector>
using namespace std;
using namespace MazeSolver;


  Maze::Maze(int rows, int columns)
{
     //Recieving the Compile Error  (C2228)
      myMazeRows.resize(rows);

     //Initializing Each Row
     for(int i=0; i< rows;i++) //Recieving the Compile Error  ( C2228 )
           myMazeRows.push_back(MazeRow(i,columns));
}

MazeRow*       Maze::getRow(int row) 
{
    //Recieving the Compile Error (C2228)
    return &myMazeRows.at(row); 
}

//Maze Row Header File
class MazeRow
   {

   public:
       MazeRow(int rowNum, vector<MazePoint>);
       MazeRow(int rowNum, int mazPoints);
  • 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-31T20:09:25+00:00Added an answer on May 31, 2026 at 8:09 pm

    At least one error the Maze::GetRow() should be:

    MazeRow*       Maze::getRow(int row)  
    { 
      return &myMazeRows.at(row);  // note the change from * to &
    } 
    

    Another possibly is that your loop in Maze constructor is to i<rows-1 — most likely should be i<rows. This will not cause compilation error, but runtime problems.

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

Sidebar

Related Questions

I'm building a simple code-first MVC 3 blog like application. My model has three
Building a search with some custom objects and three scopes: All , Active ,
I am building an app that sort of calls for three buttons in the
I'm building an app for a group of three different societies. Each society of
I'm building classes where I know the intended types of the attributes, but Python
I'm building an application with several Connector classes that interface with varied data silos.
I'm designing/building a system of classes that all derive from a single base class.
If we are building a large library of java classes, what determines when it
So for my current project, there are basically three main Java classes: GUI Instant
I've been building a number of classes in matlab and recently discovered that certain

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.