S
Sanjay
Hi all,
I was trying to read data from a file to a buffer1 and copy 'n' bytes
of data from the buffer into buffer2 in small amount. The data filling
into buffer 1 is done by spinning a thread. ex- if the buffer1 has
1024 bytes of data and still filling up the data into buffer1, and now
i want to copy the 128 bytes of data from buffer1 to buffer2 by
calling a function, how can i do it?
i'm currrently doing like this, but the copy never happens.
int thread()
{
while(nBytesRead)
{
success = ReadFile(hRead,pinBufRead, SAMPLE_READ_SIZE, &nBytesRead,
NULL);
}
return 0;
}
int copy(int size)
{
char *pbufvoid;
poutBufvoid=malloc(4096);
char *temp= &pinBufRead[0];
memset(poutBufvoid,'\0',4096);
memcpy(poutBufvoid, temp+count, size);
return 0;
}
and when i print the contents of the poutBufvoid, it is always
printing blank. Can anyone tell me how i can resolve this issue?
I was trying to read data from a file to a buffer1 and copy 'n' bytes
of data from the buffer into buffer2 in small amount. The data filling
into buffer 1 is done by spinning a thread. ex- if the buffer1 has
1024 bytes of data and still filling up the data into buffer1, and now
i want to copy the 128 bytes of data from buffer1 to buffer2 by
calling a function, how can i do it?
i'm currrently doing like this, but the copy never happens.
int thread()
{
while(nBytesRead)
{
success = ReadFile(hRead,pinBufRead, SAMPLE_READ_SIZE, &nBytesRead,
NULL);
}
return 0;
}
int copy(int size)
{
char *pbufvoid;
poutBufvoid=malloc(4096);
char *temp= &pinBufRead[0];
memset(poutBufvoid,'\0',4096);
memcpy(poutBufvoid, temp+count, size);
return 0;
}
and when i print the contents of the poutBufvoid, it is always
printing blank. Can anyone tell me how i can resolve this issue?