Re: [OT, redirect] Re: gethostbyname(string here)



Artie Gold wrote:
>
> ruroma@xxxxxxxxx wrote:
> > Hello,
> >
> > I have one problem, and can think of two possible solutions but I
> > can't manage to make them work. I'm open to other suggestions if you
> > thik is better.
> >
> > [Brief Situation] The main function calls sendSocket, but I don't know
> > how to tell it where to send the socket. ( I think I'm messing it up
> > with pointers)
[...]
> As such things are handled in a platform specific way (they are not part
> of standard C) please ask in a forum specific to your platform.
>
> [And, of course, you *should* have read the FAQ before posting.]

While the example is using gethostbyname(), the real question being
asked is "how can I get a string from the user, and pass it to a
function", which would certainly not be off-topic. The fact that
the function is gethostbyname() and not print_foo(), is irrelevant
in this instance.

His followup post showed he found the correct answer -- that fgets()
leaves the newline intact, and he had to remove it before passing the
string to the function.


--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>


.



Relevant Pages

  • RE: IE headers w patch level - new info
    ... Internet Settings\User Agent\Post Platform ... String Value: Q312461 ... The patch information that Internet Explorer displays ... logfiles, under the UserAgent field. ...
    (Focus-Microsoft)
  • Re: some interesting perspectives on .NET from the other camp ...
    ... >> now rather use framework functionality directly. ... Do you really think a VB.NET writer is any more dependent on MS ... low platform or framework level functions altogether. ... Trimming a string just seems to me to be exactly ...
    (borland.public.delphi.non-technical)
  • Re: gethostbyname problem
    ... For some reasons, gethostbyname() doesn't function ... WSADATA wsaData; ... What exactly is in this chHost string and what does it contain? ... But when try to use the same thing for the second time gethostbyname ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Wide character support
    ... > adequately translated for the new platform. ... I've printed a wide string to a narrow stream and ... Printing on GNU/Linux? ...
    (comp.lang.c)
  • Re: string length questions related to fseek
    ... > If the stream is opened in text mode, ... It even works this way if the platform doesn't ... If you process the file char by ... using string input routines, and can give you very fine control. ...
    (comp.lang.c)