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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:16:43+00:00 2026-06-17T10:16:43+00:00

I’m getting the error message ‘Unresolved overloaded type>[int] for array subscript’ in my flight-booking-system

  • 0

I’m getting the error message ‘Unresolved overloaded type>[int] for array subscript’ in my flight-booking-system program.

What I’m trying to do is set it so that if [j] is equal to 0,1,2,3… it will display accordingly as A,B,C,D. Until I started doing this my program at least compiled。

// Flight Class - Scotia 2
// 
// Contains information on seating (array), space available and return to menu option.


#include <iostream>
#include <string>
#include "passenger.h"
#include "Seat.h"

using namespace std;

/*struct Seat
        {
            int Available;
            std::string fullName;
        };// End of struct*/

class Flight
{

public:
//default constructor
Flight()
{
//initialise all seat numbers
for(int i=0;i<4;i++)
for(int j=0;j<6;j++)
    {// assigns seats as 1A, 1B etc...
    seatPlan[i][j].setRow(row);
    if(j==0)
    seatPlan[i][j].setCol('A');
    else if(j==1)
    seatPlan[i][j].setCol('B');
    else if(j==2)
    seatPlan[i][j].setCol('C');
    else if(j==3)
    seatPlan[i][j].setCol('D');
    }
}

Seat seatArray[4][6];

    void seatPlan()
    {
        for (int ROW=0;ROW<4;ROW++)
        {
            for (int COL=0;COL<6;COL++)
                {
                    cout << seatPlan[i][j].getSeatRow();
                }
        }
        // End of for loop
    }// End of seatPlan function

//method which returns true if seat is Available and false otherwise
bool getAvailable(int i, int j)
{
    if(seatArray[i][j].Available == 0)
    return true; //seat available
    else
    return false; //seat occupuied
}

string getName(int i,int j){return seatArray[i][j].fullName;}

void setAvailable(int i, int j, int a){seatArray[i][j].Available = a;}
void setName(int i,int j, string name){seatArray[i][j].fullName = name;}

private:
//variables
int row;
char col;

};// End of Flight class

The above is my flight.h file which contains the Flight class. The error message points to my constructor, with the message repeating for all the lines within that contain seatPlan[i][j].setCol('A'); and so on.

I’ll include the ‘seat.h’ file also, just in case it’s relevant.

#ifndef SEAT
#define SEAT

#include <iostream>

using namespace std;

class Seat
{

    public:
    //deafult constructor
    Seat(){available = true;}

    //accessor methods
    void setRow(int row){seatRow = row;}
    void setCol(char col){seatCol = col;}

    int getSeatRow(){return seatRow;}
    char getSeatCol(){return seatCol;}

    bool isAvailable(){return available;}
    bool switchAvailable(){
    if(available)
    available = false;
    else
    available = true;
    }

    private:
    bool available;
    int seatRow;
    char seatCol;
};

#endif
  • 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-17T10:16:45+00:00Added an answer on June 17, 2026 at 10:16 am
    seatPlan[i][j].setRow(row);
    

    Here is the problem. seatPlan is not an array. It is the name of the function.

    You meant seatArray. So it should be:

    seatArray[i][j].setRow(row);
    

    One suggestion: consider using std::array as:

    std::array<std::array<Seat,6>,4> seatArray;
    

    instead of

    Seat seatArray[4][6];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am confused How to use looping for Json response Array in another Array.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.