Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

call-by-reference for a two dimensional array ??

Status
Not open for further replies.

frag

Programmer
Dec 7, 2000
321
GB
Hi!

Here is my problem:

I want to pass a two dimensional array into a function!

this is my array:
char list[maxRows][maxCols];

this is my function:
void myBubbleSort (char test[][], int end_of_array);

I keep getting compiler-errors, because I don't know how to call the function and how to setup the "function's head" (char test[][]).

Can somebody help me please?

Thanx.

frag patrick.metz@epost.de
 
> how to setup the "function's head"

Function signature:

void myBubbleSort( char**& test, int end_of_array)


Good luck
-pete
 
palbano ??????
This will work only in your fantasy.

frag, try this:

char list[j];

function
void my(char (*in_list)[j]);
{
printf("Name:%s\n",in_list[0]);
}
call to function:
my(list);

 
I think both of you guys got me wrong.

This is my solution:

My function:
void myBubbleSort (char test[maxRows][maxCols], int anzahl);

Parameter:
char list[maxRows][maxCols];

And I call the function with:
myBubbleSort(list, i);

But thanx anyway! ;-)

cya

frag patrick.metz@epost.de
 
This will work too. Only my case will work with any number of Rows, You probably don't need this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top