hi everyone!
I am using the statement memcpy inside a function with the following code:

void extract(QByteArray buffer,unsigned long *number)
{
QByteArray byte;
byte = buffer;
memcpy(number,byte,sizeof(unsigned long));
}


when the function is called for the first time, the memcpy works fine. But it doesnot work from next time onwards. So, can any one please help me regarding this problem? what modifications are required to it or is there any other alternative to it?


advance thank you,