Re: [OT, redirect] Re: gethostbyname(string here)
- From: Artie Gold <artiegold@xxxxxxxxxxxxx>
- Date: Wed, 07 Sep 2005 18:02:53 -0500
Kenneth Brody wrote:
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.
Point taken.
However, even in a case like that, it behooves the OP to provide a visible prototype for any non-standard function (yes I know what gethostbyname() does -- but not when I'm wearing this hat ;-)).
Cheers, --ag
-- Artie Gold -- Austin, Texas http://goldsays.blogspot.com (new post 8/5) http://www.cafepress.com/goldsays "If you have nothing to hide, you're not trying!" .
- Follow-Ups:
- Re: [OT, redirect] Re: gethostbyname(string here)
- From: SM Ryan
- Re: [OT, redirect] Re: gethostbyname(string here)
- References:
- gethostbyname(string here)
- From: ruroma
- [OT, redirect] Re: gethostbyname(string here)
- From: Artie Gold
- Re: [OT, redirect] Re: gethostbyname(string here)
- From: Kenneth Brody
- gethostbyname(string here)
- Prev by Date: Re: How to write this?
- Next by Date: code problem
- Previous by thread: Re: [OT, redirect] Re: gethostbyname(string here)
- Next by thread: Re: [OT, redirect] Re: gethostbyname(string here)
- Index(es):
Relevant Pages
|