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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:19:49+00:00 2026-05-27T07:19:49+00:00

I have declared a 2_D array as int array [NO_OF_ROWS][NO_OF_COL]; NO_OF_ROWS and NO_OF_COL are

  • 0

I have declared a 2_D array as

int array [NO_OF_ROWS][NO_OF_COL];

NO_OF_ROWS and NO_OF_COL are constants.

I then have pointers *rowPtr and *seatPtr. I pass all of these to a function so I can save data from a binary file to the array along with an enumerated status as follows

 void loadArray (int* &rowPtr, int* &seatPtr, status& seatStatus,
               status seatArray[][NO_OF_COL])

in the function i try to save the status to the array with the line;

 seatArray[rowPtr][seatPtr] = seatStatus; 

when I try to compile I get the error:

invalid types ‘ status(*)[6][int*] for array subscript

I see that the array does not like the pointer value since it was declared as an int type. How would I set this up to allow the pointer to be used

  • 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-27T07:19:50+00:00Added an answer on May 27, 2026 at 7:19 am

    You declared the pointers incorrectly. Try this:

    void loadArray (int* rowPtr, int* seatPtr, status& seatStatus,
               status seatArray[][NO_OF_COL])
    

    And then dereference the pointers when you want to use their values as such:

    seatArray[*rowPtr][*seatPtr] = seatStatus; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

for each letter in the alphabet i have an int-array declared like this: int
I have a fixed-size array declared: int vals[25]; And I'd like to send the
I have declared an array in the form: var refs = { 'EE810': Presence
I have declared: queue<int, list<int> > Q After a series of calls: Q.push(37); Q.pop();
In my C# source code I may have declared integers as: int i =
Possible Duplicate: casting char[][] to char** causes segfault? I have a 2D array declared
I have an array declared inside a user defined method. I use this array
I have a variable declared in one jsp page. This variable is an array.
I have a variable called names which is a two dimensional array. I declared
I'm using C++ .NET 2.0 I have 2 forms the first one is declared

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.