See a program written the following code:
lpBuf is a pointer to a structure, and he performs the following conversion on this structure pointer
(BYTE *) lpBuf
In this way, will the data be lost? If the data is lost, can you still correctly access the members of the structure using this pointer? Thank you
Look how to say, if you know the size of the data
Traversal
In this way, the data cannot be said to be lost. If the member is accessed, it is impossible to directly interpret it as a member. It needs to be converted again
Will the conversion lose data? If the data is lost, can you use this pointer to correctly access the members of the structure? Thank you
-------------------------------------------------- -----
To access its members need to be converted into the original structure pointer
Of course, the data will not be lost, which is equivalent to interpreting the content starting from that address in a new way.
-------------------------------------------------- ------------
I don't quite understand your explanation, can you explain it?
For example, in order to achieve byte access to the data in the structure, you can choose to convert the pointer to the structure to byte*, and then use a for to access all the data, which may be used when storing the data in the database.