size of a 2D array - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

size of a 2D array

Hi everebody

I'm working with 2D arrays and in a part of a program I need to know the dimensions of a 2D array. By using the sizeof operator i can get the number of cells in the array, but this is not enough. I wonder if there is a function or operator that returns the size of a 2D array, i.e., number of columns and rows.

Thanks for yor time


emilio

Comments

  • DB1DB1 Posts: 1,142Member
    : Hi everebody
    :
    : I'm working with 2D arrays and in a part of a program I need to know the dimensions of a 2D array. By using the sizeof operator i can get the number of cells in the array, but this is not enough. I wonder if there is a function or operator that returns the size of a 2D array, i.e., number of columns and rows.
    :
    : Thanks for yor time
    :
    :
    : emilio
    :

    No there sure isn't. You need to keep track of that yourself. In memory, a 2D array is the same as a 1D array.






    [italic][blue]To understand recursive, first you need to understand recursive[/blue][/italic]

Sign In or Register to comment.