Advertisement

Type conversion...

Started by May 22, 2000 10:23 AM
0 comments, last by Doddler 24 years, 6 months ago
I was having a problem. I''m making a D3D program which exports the selected device, resolution, and device description to a file. I can''t write the pointers to file, so I''ve got to convert them into normal objects. For example, how would you convert a GUID** to GUID, and LPSTR or char* to a char[40]? Any help would be greatly apreciated. -Doddler
Assuming that you''re trying to write the data to a file what you really need is an address of the data and the size of the data. For a GUID ** (say GUID ** a) the address would be *a, and the size would be sizeof(GUID) (32 bytes if I remember correctly). For a LPSTR str or a char * str the address is the str variable, and the size of the data is strlen(str). This is important because the string length can be greater than 40 characters.

This topic is closed to new replies.

Advertisement