Mi problema es el siguiente:
  
Le paso a una funcion un Array como parametro (int makeof[][3])
pero al momento de regresar se supone que deberia de mantener los
valores que se le asignaron en la funcion y no lo hace tiene otros valores
que ni al caso; 
en la funcion: CalculaVarillas(double....  ejecuta uno de dos algoritmos 
uno es si se quiere que el calculo sea mas eficiente (en el sentido de los
valores que regresa) o normal el problema es en la seccion de eficiente
por que en la normal si mantiene los valores que se le asignaron en la funcion      
 Código PHP:
     ...
 
//-------------------------------------------------------------------------------------------
int ElementoConcreto::DameVarillas(bool eficiente){
    MaxNumeroResult=20;
 
// Si tiene acero a compresion lo calculamos las varillas necesarias
    if (isDoble) {
           if(!eficiente){
                if(CalculaVarillas(aps,eficiente,VarsAps)){
                   ACMaxres = NumerodeResult-1;
//Aqui si tiene el valor correcto
                }
                else{
                   return FALLO;
                }
           }
           else{
                if(CalculaVarillas(aps,eficiente,VarsApsEfi)){
                   ACMaxres = NumerodeResult-1;
//Cuando regreso aqui ya no tienene los valores que deberia de tener
                }
                else{
                   return FALLO;
                }
           }
    }
 
// Calculamos las varillas a tension
         if(!eficiente){
                if(CalculaVarillas(as,eficiente,VarsAs)){
                   ATMaxres = NumerodeResult-1;
//Aqui si tiene el valor correcto
                }
                else{
                   return FALLO;
                }
           }
           else{
                if(CalculaVarillas(as,eficiente,VarsAsEfi)){
                   ATMaxres = NumerodeResult-1;
//Cuando regreso aqui ya no tienene los valores que deberia de tener
                }
                else{
                   return FALLO;
                }
           }
    return OK;
}
//-------------------------------------------------------------------------
int ElementoConcreto::CalculaVarillas(double acero,bool eficiente,int makeof[][3]){
 
double AceroMin = opcionesVarillas.infAc*acero;
double AceroMax = opcionesVarillas.supAc*acero;
NumerodeResult=0;
 
 
if(eficiente){
 double res,res2;
 for (int i = opcionesVarillas.infCvar; i <= opcionesVarillas.supCvar; i++) 
 {
     for (int j = opcionesVarillas.infNvar; j <= opcionesVarillas.supNvar; j++)
         {
      res=(3.1415*pow((1.27*j/8),2))*i;
 
          for (int k = opcionesVarillas.infCvar; k <= opcionesVarillas.supCvar; k++)
                  {
             for (int h = opcionesVarillas.infNvar; h <= opcionesVarillas.supNvar; h++)
                         {
                  res2=res+(3.1415*pow((1.27*h/8),2))*k;
                  if(NumerodeResult<=MaxNumeroResult)
                                  {
                      if((res2>=AceroMin)&&(res2<=AceroMax))
                                           {
                        makeof[NumerodeResult][0]=i;
                        makeof[NumerodeResult][1]=j;
                        makeof[NumerodeResult][2]=k;
                        makeof[NumerodeResult][3]=h;
                        NumerodeResult++;
     // Hasta aqui el Array tiene los valores correctos
                           }
                     }
            }
         }
      }
  }
}
else{
     for(int i=opcionesVarillas.infCvar;i<=opcionesVarillas.supCvar;i++)
         {
            for(int j=opcionesVarillas.infNvar;j<=opcionesVarillas.supNvar;j++)
                        {
                  varilla[i][j]= (PI*pow((1.27*j/8),2))*i;
                  if(NumerodeResult<=MaxNumeroResult)
                                  {
                         if((varilla[i][j]>=AceroMin)&&(varilla[i][j]<=AceroMax))
                                                 {
                               makeof[NumerodeResult][0]=i;
                               makeof[NumerodeResult++][1]=j;
// Aqui tiene el valor correcto y al regresar si mantiene los mismos valores
                                                 }
                  }
                  else
                     return OK;
            }
        }
   }
  return OK;
}
 
//-------------------------------------------------------------------------------------------