#include "cvector.h"
#include"stdio.h"
#include <memory.h>
int main()
{
char* alloutbuf = NULL;
size_t nout = 10;
size_t nsize = 0;
int ns[3] = { 3, 2, 5 };
char* pp[] = { "123", "ab", "567" };
int i = 0;
while ( i < 3 )
{
nout = ns[i];
char* outbuf = (char*)malloc( nout );
strcpy( outbuf, pp[i] );
//int iRet = Media_GetByteArray( outbuf, &nout );
i++;
if ( outbuf )
{
alloutbuf = realloc( alloutbuf, nsize + nout );
memcpy( alloutbuf+nsize, outbuf, nout );
nsize += nout;
free( outbuf );
outbuf = NULL;
}
}
if ( alloutbuf )
{
free(alloutbuf);
alloutbuf = NULL;
}
return 0;
}
#include"stdio.h"
#include <memory.h>
int main()
{
char* alloutbuf = NULL;
size_t nout = 10;
size_t nsize = 0;
int ns[3] = { 3, 2, 5 };
char* pp[] = { "123", "ab", "567" };
int i = 0;
while ( i < 3 )
{
nout = ns[i];
char* outbuf = (char*)malloc( nout );
strcpy( outbuf, pp[i] );
//int iRet = Media_GetByteArray( outbuf, &nout );
i++;
if ( outbuf )
{
alloutbuf = realloc( alloutbuf, nsize + nout );
memcpy( alloutbuf+nsize, outbuf, nout );
nsize += nout;
free( outbuf );
outbuf = NULL;
}
}
if ( alloutbuf )
{
free(alloutbuf);
alloutbuf = NULL;
}
return 0;
}