Unable to memcpy a buffer to a struct
hi! i have a problem. i have given struct and i declare a pointer on that struct. i want to copy using MEMCPY the contents of the buffer to the struct but i encountered "MEMORY ACCESS ERROR" during my debugging.
Can someone pls help me to solve this problem?
Thanks!
Re: Unable to memcpy a buffer to a struct
Did you create an instance of this struct apart declaring a pointer to it?
Re: Unable to memcpy a buffer to a struct
I don't understand. Can you pls. post as sample code? by the way, i placed the struct on the base class. im not that familiar with this.
Thanks!
Re: Unable to memcpy a buffer to a struct
Do you know the difference between the following two statements?
Code:
somestruct *v1;
somestruct v2;
Re: Unable to memcpy a buffer to a struct
yes! thanks wysota. i already solve it. i just removed all the declared const in the struct.