Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Formal Argument for int Array[x][y]?

Reply
Thread Tools

Formal Argument for int Array[x][y]?

 
 
erktek@gmail.com
Guest
Posts: n/a
 
      11-18-2005
Hi!
It is clear that when we try to pass a one dimentional array to a
function
we use int* such as


void display(int *LocalAarray)
{
......
}

int main(void)
{
int MainArray[3] = {1, 2, 3};

display(MainArray);
return 0;
}
name of the array is automaticly casted to (int*)
but what is the case I want to use two dimensional array ?
int main(void)
{
int MainArray[2][3] = {{1, 2, 3},
{4,5,6}};

display(MainArray);

return 0;
}

what should be the formal parameter of display function?
void display(int** Local Array) ? <-- Is it true?

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between int i, j; and int i; int j; arun C Programming 8 07-31-2006 05:11 AM
Formal Argument for int Array[x][y]? erktek@gmail.com C Programming 6 11-18-2005 10:26 PM
Error : Formal argument requires an lvalue Gil C++ 6 01-31-2004 10:39 AM
int main(int argc, char *argv[] ) vs int main(int argc, char **argv ) Hal Styli C Programming 14 01-20-2004 10:00 PM
dirty stuff: f(int,int) cast to f(struct{int,int}) Schnoffos C Programming 2 06-27-2003 03:13 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57