www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - const void*

↑ ↓ ← "Shyam Iyengar" <shyam encodexindia.com> writes:
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
↑ ↓ → Jan Knepper <jan smartsoft.us> writes:
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
May 15 2003