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

  • Home
  • SEARCH
  • 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 7082959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:07:10+00:00 2026-05-28T07:07:10+00:00

This is my final version for gameoflife. I have this error bug I can’t

  • 0

This is my final version for gameoflife. I have this error bug I can’t fix. Please help me to solve this one:

1 IntelliSense: argument of type “int (*)[50]” is incompatible with parameter of type “int *“
line 79 print(board, HEIGHT, WIDTH);

void print(int *board, int rows, int cols) 
{
    int x, y;
    char c;
    for (y = 0; y < rows; y++) {
        for (x = 0; x < cols; x++) {
            if (*(board + y*cols + x) == 1)
                printf("X");
            else
                printf(" ");
        }
        printf("\n");
    }
    printf("Press any key to continue:\n");
    getchar();
}
  • 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-28T07:07:10+00:00Added an answer on May 28, 2026 at 7:07 am

    That error means you are trying to pass a function an argument of type “array of 50 pointers to int” while it should be getting an argument of type “pointer to int” (which could also be an array).

    In your case, the signature of your print() function should probably change to get an int board[][WIDTH] instead of int * which it gets now.

    The change of the signature also requires a change in the function code, so the line

    if (*(board + y*cols + x) == 1)
    

    Should be changed to:

    if (board[y][x] == 1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this case: public Class1 { public static final String ONE = ABC; public
I have this regex: private static final String SPACE_PATH_REGEX =[a-z|A-Z|0-9|\\/|\\-|\\_|\\+]+; I check if my
I have this TreeView: Main Node Header=Main Sub Node Header=Sub1 Final Node Header=Item1 Final
Hibernate-core jar version 4.0.0.Final version is not available here . My pom shows this
UPDATE: The final version of my utility looks like this: StringBuilder b = new
I can't seem to find the answer. I've just used Xcode 4 final version
I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can
Here's one I have always wondered about... Please excuse my naivety, but - How
I have to print the whole sourcecode of a java-project. The final version should
This is the final output Output http://img2.pict.com/cc/dc/64/3257730/0/20100330041140.png My HTML <li id='$id'>TEXT <ul class='indent'> <li

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.