mattias1975
Programmer
#include <winsock2.h>
#include <wininet.h>
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
void main(){
int sock = socket (PF_INET, SOCK_RAW, IPPROTO_TCP);
cout << sock;
}
But the socket function returns the value -1 which i know is an error code. I think it should return 1 if it is ok.
Why does not this work? Why do i get the error code -1?
#include <wininet.h>
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
void main(){
int sock = socket (PF_INET, SOCK_RAW, IPPROTO_TCP);
cout << sock;
}
But the socket function returns the value -1 which i know is an error code. I think it should return 1 if it is ok.
Why does not this work? Why do i get the error code -1?