How to pass the multi_array to the function? 
Author Message
 How to pass the multi_array to the function?

    And I need the data getted in the function can be returned to
the upper level. How can I tackle this problem? I ask a question about
the array as parameter before, and the kind man pull me out of  it.but  I
can't
apply the rules to the multi_array.It  seems have more complex features.It's
really
confusing me.

My program as following:
  The function:
       BOOL FindNewFiles(char* pNewsData[], long&  nNewsLen[ ],short
&ArrayNumber)

      //I passed the parameter pNewsData[2][100], nNewsLen[] to the
function. And the parameters are
     // filled with the calculated data and return to the upper level
     // The function should be accessed as following:
        //BOOL FindNewFiles(char* pNewsData[], long nNewsLen[],short&
ArrayNumber);
        if(FindNewFiles(pNewsFile,nNewsFileLength,nArrayNumber))
         {
             for(int i = 0 ; i< nDirListSize; i++)           //The
nDirListSize is defined as 2.
         {
          pFilezip = new unsigned char[*nNewsFileLength[nDirListSize]];
          memset(pFilezip,0,(unsigned int)nNewsFileLength[nDirListSize]);
          ResponseHeader.nType = PKG_TYPE_NEWSFILE;
          ResponseHeader.nContentLen =(int)*nNewsFileLength[nDirListSize];
          if(compress(pFilezip, &nFileLengthZip, pNewsFile[nDirListSize],
*nNewsFileLength[nDirListSize]) != Z_OK)
          {
           break;
          }
          if (!SendBuffer(sock[index],(char
*)&ResponseHeader,sizeof(COMMON_HEADER)))
          {
           continue;
          }
          if (!SendBuffer(sock[index],(char *)pFilezip,nFileLengthZip))
          {
           continue;
          }
         delete pNewsFile[nDirListSize];
         }
         delete pFilezip;



Tue, 14 Oct 2003 09:29:25 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to pass the multi_array parameters to the function?

2. Passing "callback" function to a function

3. passing a function to function.

4. Passing functions to functions?

5. Pointer to function passed to varargs function

6. HELP:Passing functions to functions(!)

7. Novice: Passing a function pointer to a function

8. Passing a function to a function the hard way

9. prototype (?) of function passed to function

10. Prototyping a function passed a pointer to a function

11. Passing functions to a C function?

12. Passing C++ Class Member Function to as a C Callback Function Parameter

 

 
Powered by phpBB® Forum Software