|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Gcc incorrect report Being given as follows
[root@localhost Code]# gcc gethostbyname.c
Gethostbyname.c:10 : stray '343' in program
Gethostbyname.c:10 : stray '200' in program
Gethostbyname.c:10 : stray '200' in program
Gethostbyname.c:10 : stray '343' in program
Gethostbyname.c:10 : stray '200' in program
Gethostbyname.c:10 : stray '200' in program
Gethostbyname.c : In function `main ':
Gethostbyname.c:11 : stray '343' in program
Gethostbyname.c:11 : stray '200' in program
Gethostbyname.c:11 : stray '200' in program
Gethostbyname.c:11 : stray '343' in program
Gethostbyname.c:11 : stray '200' in program
Gethostbyname.c:11 : stray '200' in program
Gethostbyname.c:13 : stray '343' in program
Gethostbyname.c:13 : stray '200' in program
Gethostbyname.c:13 : stray '200' in program
Gethostbyname.c:13 : stray '343' in program
Gethostbyname.c:13 : stray '200' in program
Gethostbyname.c:13 : stray '200' in program
Gethostbyname.c:14 : stray '343' in program
Gethostbyname.c:14 : stray '200' in program
Gethostbyname.c:14 : stray '200' in program
Gethostbyname.c:14 : stray '343' in program
Gethostbyname.c:14 : stray '200' in program
Gethostbyname.c:14 : stray '200' in program
Gethostbyname.c:15 : stray '343' in program
Gethostbyname.c:15 : stray '200' in program
Gethostbyname.c:15 : stray '200' in program
Gethostbyname.c:15 : stray '343' in program
Gethostbyname.c:15 : stray '200' in program
Gethostbyname.c:15 : stray '200' in program
Gethostbyname.c:17 : stray '343' in program
Gethostbyname.c:17 : stray '200' in program
Gethostbyname.c:17 : stray '200' in program
Gethostbyname.c:17 : stray '343' in program
Gethostbyname.c:17 : stray '200' in program
Gethostbyname.c:17 : stray '200' in program
Gethostbyname.c:18 : stray '343' in program
Gethostbyname.c:18 : stray '200' in program
Gethostbyname.c:18 : stray '200' in program
Gethostbyname.c:18 : stray '343' in program
Gethostbyname.c:18 : stray '200' in program
Gethostbyname.c:18 : stray '200' in program
Gethostbyname.c:19 : stray '343' in program
Gethostbyname.c:19 : stray '200' in program
Gethostbyname.c:19 : stray '200' in program
Gethostbyname.c:19 : stray '343' in program
Gethostbyname.c:19 : stray '200' in program
Gethostbyname.c:19 : stray '200' in program
Gethostbyname.c:21 : stray '343' in program
Gethostbyname.c:21 : stray '200' in program
Gethostbyname.c:21 : stray '200' in program
Gethostbyname.c:21 : stray '343' in program
Gethostbyname.c:21 : stray '200' in program
Gethostbyname.c:21 : stray '200' in program
Gethostbyname.c:23 : stray '343' in program
Gethostbyname.c:23 : stray '200' in program
Gethostbyname.c:23 : stray '200' in program
Gethostbyname.c:23 : stray '343' in program
Gethostbyname.c:23 : stray '200' in program
Gethostbyname.c:23 : stray '200' in program
As follows
[code]
#include "Stdio.h>
#include "Stdlib.h>
#include "Errno.h>
#include "Netdb.h>
#include "Sys/types.h>
#include "Netinet/in.h>
#include "Sys/socket.h>
Int
Main (int argc, char *argv[])
{
Struct hostent *h;
If (argc> 2) (LEAVES OF 13 SPECIES OF LAURACEAE orders inspection trip */
Fprintf (stderr, "usage : getip addressn");
Exit (1);
}
If ((h=gethostbyname (argv[1])) ====== NULL) (LEAVES OF 13 SPECIES OF LAURACEAE address information obtained */
Herror ( "gethostbyname");
Exit (1);
}
Printf ( "Host name : %sn" h->h_name);
Printf ( "IP Address : %sn", inet_ntoa (* ((struct in_addr *) h->h_addr)));
Return 0
}
[/code] |
Gcc compiler I use the PC in National Taiwan Normal University, she responds : No,
Import : 192.168.0.231
Output : Host name : 192.168.0.231
IP Address : 192.168.0.231
Import : 1921680231
Output : Host name : 1921680231
IP Address : 114.138.131.103 |
Your code is scrutinized, or shear adhesive to the manual input, which should be imported English characters instead of bars. Re lose again, the reason is Chinese characters.
Code itself has no problem, is that you may not be imported in the whole angle? Kind of characters.
|
Do not blame me : (box is the problem |
Young people, to be honest scholarship or write again, instead of always copy |
-->
Em13 : : |
| |