![]() |
|
#1
|
|||
|
|||
Please help segmentation fault problemI am trying to produce a c program that downloads a web page using sockets, however when i compile i get a warning message:
webclient.c: In function `main': webclient.c:61: warning: passing arg 2 of `connect' from incompatible pointer type Then when i run the program i get a segmentation fault I cant work out why :-? :-? , heres the code: Code: CPP / C++ / C Code:
Last edited by LuciWiz : 08-May-2005 at 23:14.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#2
|
|||
|
|||
|
you need to cast structure socketaddr to struct sockaddr and size should be size of struct sockaddr
CPP / C++ / C Code:
Also http request should be terminated with "\r\n" so your get request should be CPP / C++ / C Code:
|
Recent GIDBlog
Writing a book by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Graphic problem in Unreal Tournament 2004 | zerox | Computer Software Forum - Games | 10 | 09-Oct-2005 12:31 |
| Help with segmentation fault | boris | C Programming Language | 1 | 02-Feb-2005 14:25 |
| segmentation fault in c++ | rushman8282 | C++ Forum | 2 | 26-Jan-2005 03:38 |
| Segmentation Fault? | aaroncohn | C++ Forum | 2 | 02-Jan-2005 14:22 |
| child pid xxx exit signal Segmentation fault (11) | bezak | Apache Web Server Forum | 1 | 24-Nov-2003 09:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The