F
Frits JK
Please help.
I have to make a little change to a DLL , original there was a static char
szIPAddr, and I want to make it variable. Unfortunately I am not good enough
with C++ syntax
original syntax was :
//-----------------------------------------------------------------
extern "C" int PASCAL EXPORT ReadMidi( void )
{
static char szIPAddr[32] = { "10.0.0.4" } ;
static struct sockaddr_in sa ;
sa.sin_addr.S_un.S_addr = inet_addr (szIPAddr) ;
Desired syntax
//------------------------------------------------------------------
extern "C" int PASCAL EXPORT ReadMidi( char szIPAddr )
{
static struct sockaddr_in sa ;
sa.sin_addr.S_un.S_addr = inet_addr (szIPAddr) ;
this gives error :
: error C2664: 'inet_addr' : cannot convert parameter 1 from 'char' to
'const char *'
Conversion from integral type to pointer type requires reinterpret_cast,
C-style cast or function-style cast
Regards,
Frits Janse Kok
I have to make a little change to a DLL , original there was a static char
szIPAddr, and I want to make it variable. Unfortunately I am not good enough
with C++ syntax
original syntax was :
//-----------------------------------------------------------------
extern "C" int PASCAL EXPORT ReadMidi( void )
{
static char szIPAddr[32] = { "10.0.0.4" } ;
static struct sockaddr_in sa ;
sa.sin_addr.S_un.S_addr = inet_addr (szIPAddr) ;
Desired syntax
//------------------------------------------------------------------
extern "C" int PASCAL EXPORT ReadMidi( char szIPAddr )
{
static struct sockaddr_in sa ;
sa.sin_addr.S_un.S_addr = inet_addr (szIPAddr) ;
this gives error :
: error C2664: 'inet_addr' : cannot convert parameter 1 from 'char' to
'const char *'
Conversion from integral type to pointer type requires reinterpret_cast,
C-style cast or function-style cast
Regards,
Frits Janse Kok