Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 27th, 2008, 04:38 PM
puzzlecracker
Guest
 
Posts: n/a
Default what's wrong with my code func(ptr **) when passing double array



f(int** x)
{


}


int main (){

int array[4][5];

f(array);

}



thanks

  #2  
Old June 27th, 2008, 04:38 PM
Ian Collins
Guest
 
Posts: n/a
Default Re: what's wrong with my code func(ptr **) when passing double array

[put the question in the body as well as the heading]

puzzlecracker wrote:
Quote:
>
f(int** x)
{
}
>
int main (){
>
int array[4][5];
>
f(array);
}
>
http://c-faq.com/aryptr/pass2dary.html

--
Ian Collins.
  #3  
Old June 27th, 2008, 04:38 PM
Juha Nieminen
Guest
 
Posts: n/a
Default Re: what's wrong with my code func(ptr **) when passing double array

puzzlecracker wrote:
Quote:
>
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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.