Re: one more C question ( mixedlib.e )
- Posted by cense <cense at mail.ru> Aug 31, 2000
- 416 views
On Thu, 31 Aug 2000, Bernie wrote: > cense: > I need to see the actual "C" function you are using to really understand > what you are doing so I can help you. > I think you probably will be passing a POINTER to a structure > because there is no way to pass the value of a structure. > You could only pass the value of a single entry that is contained > in a structure. > Normally you will pass a POINTER to a "C" function in a predefined > structure format that the "C" function is expecting. The "C" > function code then USES that POINTER to move data in and out of > the predefined structure and returns a flag to tell you if exceeded. > > Hope this helps. > > Bernie Ok bernie, here is the C function prototype and the struct that this function wants: < fun C code > /* this is the function ( you probaly know of it ) */ char *inet_ntoa( struct in_addr inaddr ); // does this really want a pointer? /* here is the struct ( ya probably know about this one too ) */ struct in_addr { u_long s_addr; // 32-bit netid/hostid in network byte order }; <end the fun of it all > so does char *inet_ntoa( struct in_addr inaddr ); really want a pointer to a in_addr struct or the "value"? im so confused when it comes to memory related things and pointers in C. -- cense a member of the ak-software development team http://ak-software.virtualave.net/ contract work for Web Velocity IT inc. http://www.webvelocity.ca/