mattias1975
Programmer
I have made a small program:
#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 knowis a 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 <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 knowis a 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.