Another cast question.....
Ok, so i have a struct..... lets say....
struct _VERTEX
{
float z, y, z;
} VERTEX;
now, I have created a memory mapped file. MapViewOfFile returns LPVOID. How can i cast the LPVOID to VERTEX? I am asking this because i want to take stuff from the file, and have it read like vertex. File will be all binary structured like.....
[x][y][z][x][y][z][x][y][z]
|-------|
|
I would like to be able to read this part of the file using a memory mapped file.... argh... if I am not making any sense please let me know. I will try and make it clearer. thanks for any help.
void *pData;_VERTEX *pVertices = (_VERTEX*) pData;// or (in C++) to be more specific_VERTEX *pVertices = reinterpret_cast<_VERTEX*>(pData);
You can then treat pVertices as an array.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement