May 15, 2003 const void* | ||||
---|---|---|---|---|
| ||||
Guys, I have a buffer buf. It's defined as const void* buf (In the param of a function). BOOL Write(const void* buf, ULONG nBytes, ULONG* pBytesWritten = NULL) { } How can I access this variable data. Is it by capturing it in const char* or something else. Shyam |
May 15, 2003 Re: const void* | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shyam Iyengar | Depends on whether you are coding C or C++ > BOOL Write(const void* buf, ULONG nBytes, ULONG* pBytesWritten = NULL) > { const char *ptr = ( const char * ) buf; // Should work for C and C++ const char *ptr = static_cast < const char * > ( buf ); // Should work for C++ > } > > How can I access this variable data. > > Is it by capturing it in const char* or something else. -- ManiaC++ Jan Knepper |
Copyright © 1999-2021 by the D Language Foundation