
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;