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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:04:46+00:00 2026-06-13T11:04:46+00:00

Out of curiosity, I change the line to set_array(&array1[0]) in the following from set_array[array1]

  • 0

Out of curiosity, I change the line to set_array(&array1[0]) in the following from set_array[array1], the parameter is not the same type, but it works, any idea?

#include <stdio.h>
void set_array(int array[][9]);
int main(void) {
    int array1[4][9];
    for(int i = 0; i < 4; i++) {
        for(int j = 0; j < 9; j++) {
            array1[i][j] = j + 1;
        }
    }
    set_array(&array1[0]);
    for(int i = 0; i < 4; i++) {
        for(int j = 0; j < 9; j++) {
            printf("%d ", *(*(array1 + i) + j));
            //printf("%d ", array1[i][j]);
        }
        puts("\n");
    }
    return 0;

}
void set_array(int array[][9]) {
    for(int i = 0; i < 4; i++) {
        for(int j = 0; j < 9; j++) {
            array[i][j] = 1;
        }
    }   
};
  • 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-13T11:04:47+00:00Added an answer on June 13, 2026 at 11:04 am

    here array1 is having the address of whole array of 1st row(or column)depending upon implementation. (&array1[0])is same as (array1) of type ()[n] sice array name itself contains the address of the ist element .But when you pass (&array) which of type ()[m][n] and compiler will throw an error because mismatch of argument type.

    I think you haven’t read my comments in the last question you asked

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

Sidebar

Related Questions

This is not an issue but I am asking out of curiosity as I
Out of curiosity, what is the reasoning behind typeof not being a regular method
I'm comfortable using git, but have been exploring Mercurial lately out of curiosity based
This question is more out of curiosity than purpose. Can we change the output
Out of curiosity im interesting in finding out which ranges are reserved for localhost
Out of curiosity, why are sometimes multiple Java .class files generated for a class
Out of curiosity, I wonder what can people do with parsers, how they are
Out of curiosity I've been playing with jQuery to determine the browser's screen size,
Out of curiosity about reverse engineering, I am thinking of writing a simple program
Out of curiosity, I've been reading up a bit on the field of Machine

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.