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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:38:19+00:00 2026-05-23T17:38:19+00:00

.h file @interface GameState :NSObject{ int SymbolsPositions[3][5]; } -(void)SaveCurrentGameState:(int **)Array; @end @interface GameViewController :

  • 0

.h file

@interface GameState :NSObject{
int SymbolsPositions[3][5];
}
-(void)SaveCurrentGameState:(int **)Array;
@end


@interface GameViewController : UIViewController 
{
  ...
 int sequence_after_spin[3][5];
  ...
}
-(Void)AMethod;
@end

.m file

@implementation GameState
-(void)SaveCurrentGameState:(int **)Array
{   
    for(int i = 0;i<5;i++)
     for(int j = 0;j<3;j++)
       NSLog(@" %d",Array[j][i]);
}
 @end


@implimentation GameViewController
-(void)AMethod
 {
   [instanceOfGameState SaveCurrentGameState:sequence_after_spin];
  }
@end

the application crashes when ever AMethod is called iget following warning

warning: incompatible pointer types sending 'int [10][5]' to parameter of type 'int **' [-pedantic]
  • 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-23T17:38:20+00:00Added an answer on May 23, 2026 at 5:38 pm

    The argument needs to take an array of int[][5], the reason for this is because the compiler needs to know the number of columns to correctly identify where the members are. You could also specify int[10][5] as the parameter type if you always take the same size array.

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

Sidebar

Related Questions

Here's my try: H file: @interface Strings : NSArray @end M file: @implementation Strings
This is the original header file: @interface TestDataHelper : NSObject { } +(void) populateTestData:(NSManagedObjectContext*)
I have an aidl file defined as follows: package com.erbedo.callalert; interface RemoteCallAlert { void
I will explain my question from an example. In .H file// @interface Employee:NSObject{ @private
I have a variable declared in the header file : @interface int _nPerfectSlides; and
I made a custom class. This is the h file @interface Player : NSObject
My header file: @interface MapViewController : UIViewController <MKMapViewDelegate, NSFetchedResultsControllerDelegate> { MKMapView *mapView; NSFetchedResultsController *fetchedResultsController;
Here's the header file: @interface calc : NSObject { IBOutlet NSTextField *tf1; IBOutlet NSTextField
I have the following code in my .h file: @interface Utils : NSObject {
First my .h file: @interface SettingsViewController : UIViewController <UINavigationControllerDelegate> { IBOutlet UISwitch *gravaSwitch; ...

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.