473,395 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,395 software developers and data experts.

what's wrong with my code func(ptr **) when passing double array



f(int** x)
{
}
int main (){

int array[4][5];

f(array);

}

thanks
Jun 27 '08 #1
2 1410
[put the question in the body as well as the heading]

puzzlecracker wrote:
>
f(int** x)
{
}

int main (){

int array[4][5];

f(array);
}
http://c-faq.com/aryptr/pass2dary.html

--
Ian Collins.
Jun 27 '08 #2
puzzlecracker wrote:
>
f(int** x)
{
}
int main (){

int array[4][5];

f(array);

}
Your f() function expects an array of pointers, but your 'array' does
not contain pointers, it just contains ints. (The fact that your array
of ints can be double-indexed doesn't make it an array of pointers.)

There are no pointers anywhere in 'array', thus it cannot be converted
into an array of pointers.
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ooze | last post by:
In the unix like system, there is a func ptr signal defined as below at the last line ,but I don't know how to understand it. becoz the more general to define a func ptr is the following void...
1
by: Handi | last post by:
hi. i want to store the current state before window close, how to write code when window closing ( before window close) ? Thanks
2
by: Matthias H. | last post by:
Hi guys, Our team has a very strange problem. I hope anybody can help. We have a class called webpage and all our aspx-pages bases on it. Then we have a SYS.IO.File Class which have a...
4
by: Torben Laursen | last post by:
Hi Is there a way to prevent the debugger from stepping into the stl code when I am debugging my code? Thanks Torben
1
by: arice | last post by:
I need to create a timer and begin processing tasks in my asp.net code when IIS starts or restarts. I do not know of any way to execute even my global procedures without some external application...
5
by: python101 | last post by:
class Test: def __init__(self): self._power = False self._v = 5 self._station = 80.0 self._presets= def togglePower(self): # when I tried it this did...
4
by: remlostime | last post by:
struct lineType { int x, y; lineType(int tx, int ty) { if (tx == 0) { ty = 1 << 20; tx = 1; }
1
by: kenneth6 | last post by:
i am having an array. expected to contain these: array Peter2 array Smith array 2a@#6+ array 261 array Win I want to handle this array. what type of this array should i use without problem?
2
by: gsherp | last post by:
How does one execute code when the user closes the browers window by clicking on the top right corner . I need to log out user and do a database write when the user closes the brower. I do these to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.