473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

which .h or lib should i include before i use "inet_ntoa"

2
I tried to run "inet_ntoa(*((struct in_addr *)h->h_addr))", but it always says 'inet_ntoa' has not been declared.
What head file should i include to make the above code running? The following is the head files I have already included.

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
whatelse do i need?
I m running the code under linux.
g++
thnx
Jun 29 '06 #1
1 10954
Banfa
9,065 Expert Mod 8TB
googling "inet_ntoa" suggests

you need these 3 headers

Expand|Select|Wrap|Line Numbers
  1.  #include <sys/socket.h>
  2.  #include <netinet/in.h>
  3.  #include <arpa/inet.h>
you don't have the last one included.
Jun 29 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: vasu1308 | last post by:
Hi all I am working on a socket program in Perl. Main goal is to develop a proxy server. Here is the code attached. An error is encountered. Anyone Please help me out. #!/usr/bin/perl -w #...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.