Frits JK wrote:
> 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" } ;
Note that the above variable is an array of characters,
not just a single one.
> 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 )
This should be:
extern "C" int PASCAL EXPORT ReadMidi(char * szIPAddr)
Note the location of '*'.
> {
> static struct sockaddr_in sa ;
> sa.sin_addr.S_un.S_addr = inet_addr (szIPAddr) ;
>
> Regards,
>
> Frits Janse Kok
>
>
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book