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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:41:58+00:00 2026-06-15T22:41:58+00:00

can i do some calculation using the sizeof operator in c to get the

  • 0

can i do some calculation using the sizeof operator in c to get
the rows count inside a function who receives as a parameter only
a two dimensional array without any information about rows or columns count in this passed array?

void main(void){
    int A[5][6];
    int columnsC = sizeof(A[0]) / sizeof(int);
    int rowsC = ( sizeof(A)/sizeof(int) ) / columnsC;
    printf("rows: %d\ncolumns: %d\n", rowsC, columnsC);

    getch();
}

the previous code worked for me, but i can’t find a helpful resource to know how to apply this on a function of the following header:

void fun(int arr[][10])

i”m studying a course on Programming Languages Principles, and some times think of things differently and look for learning resources, and this helps a lot, but not this time apparently.

i admire any help.

  • 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-15T22:41:59+00:00Added an answer on June 15, 2026 at 10:41 pm

    No. There’s no way find the size of an array when passed to a function. Array decays into a pointer when passed to a function.

    This:

    void fun(int arr[][10])
    

    is actually syntatic sugar for:

    void fun(int (*arr)[10])
    

    Instead you can pass the size as a thrid argument or size as an element of the array itself.

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

Sidebar

Related Questions

I'm confused to using round function in PHP, I have make some calculation function
My C# WinForms UI has some parameters that the user can adjust using sliders.
I'm using the C API of numpy to write some functions for matrix calculation.
I need to get the end date of the given month for some calculation
I'm using jQuery and I want to show some calculation in a span (called
Wondering if i can get some help with a problem i'm having? I have
I'm using SQL to perform a basic calculation and I can't figure out the
I have a small app, where user can make some calculations and solve equations.
Can some one please explain why this loop never 'breaks' and goes on forever
Can some one please tell me why exactly classes were introduced in C++. Are

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.