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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:38:39+00:00 2026-05-30T04:38:39+00:00

Compiler warning(1): Incomplete implementation I’ve compared my .h and .m files to see any

  • 0

Compiler warning(1): Incomplete implementation

I’ve compared my .h and .m files to see any inconsistencies or spelling mistakes between whats declared and implemented and can’t find any.

Compiler warning(2): Incompatible integer to pointer conversion sending ‘NSInteger*’ (aka ‘int*’) with and expression of type ‘int’.

I’ve been mucking about with asterisks for 25 minutes in all sorts of combinations and the compiler is still unhappy.

#import "Game.h"
#import "stdlib.h"

const int MAXRAND = 15;
const int MAXCOL = 7;
const int MAXROW = 9;

NSInteger gameState[MAXROW][MAXCOL];
NSInteger answerBoard[MAXROW][MAXCOL];

@implementation Game//compiler warning 1


-(void)init:(NSInteger*) rows: (NSInteger*) columns: (NSInteger*) operators:(NSInteger*) operands{
    NSLog(@"init sent");
    numRows = *rows;
    numColumns = *columns;
    numOperators = *operators;
    numOperands = *operands;
    //seed random number generator

    //generate rand nums for operands
    int operandList[numOperands];
    for (int i = 0; i < numOperands; i++) {
        srandom(time(NULL));
        operandList[i] = (random()%MAXRAND);
    }
    //generate state and answer board
    BOOL gameState[numRows][numColumns];
    NSInteger answerBoard[numRows][numColumns];    
    for (int i = 0; i < numRows; i++) {
        for (int j = 0; j < numColumns; j++) {
            gameState[i][j] = NO;
            answerBoard[i][j] = (operandList[random()%numOperands])+
            (operandList[random()%numOperands])-
            (operandList[random()%numOperands]);
        }

    }
}

-(void)updateGame:(NSInteger*)enteredNum{
    NSLog(@"updateGame sent");
    for (int i = numColumns; i > 0; i--) {
        for (int j = numRows; j > 0; j--) {
            if (gameState[i][j] == NO){
                if (*enteredNum == answerBoard[i][j]){
                    gameState[i][j] = YES;
                }
            }

        }
    }
}


@end//Game

#import <Foundation/Foundation.h>

@interface Game : NSObject
{
    NSInteger numRows, numColumns, numOperators, numOperands;
}

-(void)init:(NSInteger*) rows: (NSInteger*) columns: (NSInteger*) operators:(NSInteger*) operands;
-(void)updateGame:(NSInteger*) enteredNum;

@end

Where the instance of my class is declared and initialized:

 NSInteger *rows = 7, *columns = 6, *operators = 2, *operands = 6;//compiler warning 2
 Game *game = [Game new];
 [game init:rows :columns :operators :operands];
  • 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-30T04:38:41+00:00Added an answer on May 30, 2026 at 4:38 am
    NSInteger *rows = 7, *columns = 6, *operators = 2, *operands = 6;
    

    rows,columns, operators, operands are of type NSInteger *. You need to allocate memory and then need to place 7,6,2,6 in the memory locations they are pointing at. In C-terms,

    int *ptr = 7; // Wrong. Because, ptr is pointing no where to keep 7 in that location.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to suppress a specfic compiler warning in C#. Now I can do
All this originated from me poking at a compiler warning message (C4267) when attempting
Here is the function where I get the compiler warning, I can't seem to
I work on a large project and want to disable the Eclipse compiler warning
For example, I get this compiler warning, The event 'Company.SomeControl.SearchClick' is never used. But
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
I am getting this compiler (gcc 4.5) warning: Formatter.cpp:23: warning: unknown conversion type character
Why does the C# compiler not even complain with a warning on this code?
Is there a comprehensive list of error/warning messages for the g++ compiler available online?
With the Visual Studio 2005 C++ compiler , I get the following warning when

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.