473,383 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Returning Number of Rows and Colums in a 2-D array in C

Dear all,

I hope you can help. Is any one aware of a function that would return the number of Rows and Columns of a 2-D array in C ( Matrix)?

Or, how to go about writting a function with the Matrix as an input array and numbers of the matrix rows and columns (Similar to SIZE( ) function in MATLAB) as outputs.

Best regards,

BASHAR AHMAD
Aug 22 '07 #1
4 2927
RedSon
5,000 Expert 4TB
Dear all,

I hope you can help. Is any one aware of a function that would return the number of Rows and Columns of a 2-D array in C ( Matrix)?

Or, how to go about writting a function with the Matrix as an input array and numbers of the matrix rows and columns (Similar to SIZE( ) function in MATLAB) as outputs.

Best regards,

BASHAR AHMAD
I don't understand your question, when you declare a 2D array you specify the number of rows and columns.
Expand|Select|Wrap|Line Numbers
  1. int array[10][12]
why do you need to determine the size if you already know it?
Aug 22 '07 #2
I don't understand your question, when you declare a 2D array you specify the number of rows and columns.
Expand|Select|Wrap|Line Numbers
  1. int array[10][12]
why do you need to determine the size if you already know it?
Hi,

In case a 2-D array is to be passed to as an input to a function who declares this input parameter as a pointer. IS there a way that this function can realise the 2-D dimensions i.e. number of row and columns.

Best Regards,
Hefty
Aug 22 '07 #3
Banfa
9,065 Expert Mod 8TB
In case a 2-D array is to be passed to as an input to a function who declares this input parameter as a pointer. IS there a way that this function can realise the 2-D dimensions i.e. number of row and columns.
No, you either have to pass the width and height as parameters or if you are using C++ then you could create a class for ayour matrix and pass references to matrix objects which would know their own height and width.
Aug 22 '07 #4
RedSon
5,000 Expert 4TB
Is this a homework assignment? It sounds suspiciously like another post in this forum.
Aug 22 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Michael Trosen | last post by:
Hi Everyone, I hope someone can help, I'm pretty new to pro*c programming. I have the following application setup: a pro*c program calls a stored procedure and recieves a cursor back: the...
5
by: Gent | last post by:
I have two questions which are very similar: Is it possible to return an object in C++. Below is part of my code for reference however I am more concerned about the concept. It seems like the...
4
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript...
0
by: D. Dante Lorenso | last post by:
I need to know that original number of rows that WOULD have been returned by a SELECT statement if the LIMIT / OFFSET where not present in the statement. Is there a way to get this data from PG ?...
8
by: shan | last post by:
How to return an two dimensional array in user defined function to main function. I think it is posible by using pointers but don't know how to code.or is there any method without using...
6
by: Ward Germonpré | last post by:
Hi, I have a reference to a dom table. How can I retrieve the number of columns in that table ? The stop value below doesn't work, nor did my experimenting with tbodies and childNodes.. .......
11
by: jza | last post by:
Hello all, I am fairly new to c, coming from a Java background. I am working on a mathematical program and I have a function that needs to return a 2-d array. After some web searching, I have...
13
by: Karl Groves | last post by:
I'm missing something very obvious, but it is getting late and I've stared at it too long. TIA for responses I am writing a basic function (listed at the bottom of this post) that returns...
5
by: ctj951 | last post by:
I have a very specific question about a language issue that I was hoping to get an answer to. If you allocate a structure that contains an array as a local variable inside a function and return...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.