473,387 Members | 1,495 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,387 software developers and data experts.

How to pass the arguments as a two-dimensional array of typedef to function

1
Please help me out. I graduated 10 years ago in Computer Information Systems. But my job doesn't related to what I studied. Luckly, My best friend help me find a job in this field to improve my technical skill.
I am training right now. I am wondering if you or somebody can explain to me about the typedef 2-dimensional arry.
Suppose I have typedef two_Darr[3][3];
Can you tell me how to declare this and how to pass it to other function definition in the main function

I appreciated that all your help.

thank you again.
Jul 12 '12 #1
3 3560
weaknessforcats
9,208 Expert Mod 8TB
Read this: http://bytes.com/topic/c/insights/77...rrays-revealed.

Your question is answered in this article. Post again if you need more info.
Jul 12 '12 #2
donbock
2,426 Expert 2GB
Presumably you meant something more like this:
Expand|Select|Wrap|Line Numbers
  1. typedef int two_Darr[3][3];
Jul 13 '12 #3
weaknessforcats
9,208 Expert Mod 8TB
First, an array can't be a type. It is a collection of many things of the same type.

Second, the name of the array is the address of element 0.

Third, element 0 has a type.

Therefore, you can typedef that address. This array:

Expand|Select|Wrap|Line Numbers
  1. int two_Darr[3][3];
is an array of 3 elements where wach element is an array of 3 int. Therefore, element 0 is the address of an array of three int.

Expand|Select|Wrap|Line Numbers
  1. typedef int (*MyArray)[3];
would say that MyArray is a pointer to an array of 3 int.

So this should work:

Expand|Select|Wrap|Line Numbers
  1. int arr[3][3];
  2. MyArray ptr;
  3. ptr = arr;
Jul 13 '12 #4

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

Similar topics

0
by: Raj | last post by:
hi, How to pass a Two Date parameter to a report at runtime using VB .NET 1. How do we pass multiple values eg. Startdate, EndDate to crystal reports parameter. 2. I have a report to...
3
by: Dthmtlgod | last post by:
I want to pass the value to two frames and two pages after hitting the submit button If my form I have this <form method="get" action="search2.asp" target="fSearch2"> I want to pass crPN to...
1
by: Clinton Pierce | last post by:
I've got a class that I want to access remotely. The touble is, I can't figure out how to call the constructor of the class with arguments -- and the arguments are necessary to initialize the...
15
by: Prachi Dimble | last post by:
Hi, In vb.Net one can pass arguments to properties. How does one achieve it in c#? Given below is the vb.net code for passing arguments to property getters and setters.. Thanks, Prachi ...
2
by: Glenn | last post by:
Hello Is it possible to pass arguements to a .net service once it is in a running state. If this is not possible , are they alternative ways in which to achive the same thing? Glenn
3
by: alex_glaros | last post by:
How can I pass an argument in this line below? http://publicdocs.medbd.ca.gov/pdl/mbc.aspx?qtxtLicenseNumber=33287 If I remove this ?qtxtLicenseNumber=33287 and just type 33287 in the search...
1
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i...
2
by: loopz123 | last post by:
Hi all, How can i pass arguments while calling other application from vb.
0
by: regal | last post by:
I am new to Vb, I need to transfer ~1000 arguments/strings from vb6 to dos prompt, i am using "wshshell.run" to perform this, the code seem to be working fine when I try to transfer lesser arguments...
6
by: Peter Morris | last post by:
My app is a single-instance one. When a second instance is executed I need to pass the startup arguments to the existing instance. Can anyone recommend a good approach for this? I tried the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.