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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array passing c++ BETA.

Status
Not open for further replies.

Disruptive

Programmer
Mar 8, 2005
40
GB
I have the beta version of VS.NET using C++. 2005

I am noting some strange behaviour when passing a three dimensional array around a number of functions. By default c++ should be passing the array by default as I cascade through functions i.e. fn A passes array to function B which passes array to function C to function D. But I am finding that this is not the case. Any ideas why this is so, I have noted problems with that I am not getting the correct values. Any limit on the amount of passing by reference?

Thanks

Brett
 
Show us how you declare the array, and declare the functions you're passing the array to.

--
 
All arrays are multidimensional

double sarray[3][3];

Functions are of the form:


void FunctionB(double myarray[][3], ....)
{

FunctionC(myarray);

}


void FunctionA(double myarray[][3], ....)
{

FunctionB(myarray);

}

This after so many cascades - say 5/6 does'nt seem to work. Any ideas?

 
Seems OK so far.

What about your indexing of the array (or other variables close to where the array is originally declared). Are you sure you're not stepping off the ends?

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top