From: Edward Parrilla <eparrilla@comcast.net>
To: kaanoken@crew.org.ru
Cc: linux prg <linux-c-programming@vger.kernel.org>
Subject: Re: passing host name from a structure.
Date: 06 Oct 2004 21:02:57 -0500 [thread overview]
Message-ID: <1097114574.4086.683.camel@localhost.localdomain> (raw)
In-Reply-To: <20041007024448.5c42e951.kaanoken@crew.org.ru>
I tried with that it didn't work. It works when I add the
#include <netdb.h>
however when I add that library, it doesn't allow the "fprintf" and
"strupr" to work, any ideas?
Got the following error
/tmp/ccD8SAtf.o(.text+0x37f): In function `main':
: undefined reference to `fprint'
appears as "fprint" even when I put "fprintf"
any ideas?
On Wed, 2004-10-06 at 17:44, Alphex Kaanoken wrote:
> On 06 Oct 2004 16:47:27 -0500
> Edward Parrilla <eparrilla@comcast.net> wrote:
>
> > Hi Experts,
> > here a question for you, I have defined the following
> >
> >
> > #define bcopy(a,b,c) strncpy(b,a,c)
> >
> >
> > struct sockaddr_in sa; /* socket addr. structure */
> > struct hostent * hp; /* host entry */
> > char *hostname;
> >
> > hostname=argv[3];
> >
> > hp=gethostbyname(hostname); <-- get this error " warning: assignment
> > makes pointer from integer without a cast
> > "
> so, it's wrong write
> hp=gethostbyname((const char*)hostname);/*but why you need pointer hostname? may be use argv[3] instead?*/
> see `man gethostbyname' for details
> >
> >
> > bcopy((char *)hp->h_addr, (char *)&sa.sin_addr, hp->h_length); <--
> > getting dereferencing pointer to incomplete type
> >
> > Any idea?
> > thanks in advance
> > Edward
> >
> >
> >
> >
> >
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2004-10-07 2:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-06 10:44 C language(asm construct) Ankit Jain
2004-10-06 21:47 ` passing host name from a structure Edward Parrilla
2004-10-06 22:44 ` Alphex Kaanoken
2004-10-07 2:02 ` Edward Parrilla [this message]
2004-10-07 5:03 ` Jeff Woods
2004-10-07 6:23 ` Edward Parrilla
2004-10-07 6:34 ` mapping client to port Edward Parrilla
2004-10-08 15:02 ` C language(asm construct) Suciu Flavius
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1097114574.4086.683.camel@localhost.localdomain \
--to=eparrilla@comcast.net \
--cc=kaanoken@crew.org.ru \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).