1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

socket program

Discussion in 'C' started by kush, Oct 6, 2011.

  1. kush

    kush New Member

    Code:
    //#include"stdafx.h"
    #include<windows.h>
    #include<winsock.h>
    #include<stdio.h>
    #include<windows.h>
    int APIENTRY WinMain(HINSTANCE hlnstance,HINSTANCE hprevlnstance,LPSTR lpCmdLine,int nCmdShow)
     {
                 WSADATA ws;
                 char buf[1000],buf1[100],buf2[100],buf3[100],buf4[100],buf5[100],buf6[100];
                 WSAStartup(0x0101,&ws);
                 // buf[0]=" ";
                 sprintf(buf1,"\nWinsock Ver Request: %d.%d",HIBYTE(ws.wVersion),LOBYTE(ws.wVersion));
                 sprintf(buf2,"\nWinsock Ver Avilable: %d.%d",HIBYTE(ws.wHighVersion),LOBYTE(ws.wHighVersion));
                 sprintf(buf3,"\nCurrent Winsock imlementation: %s",&ws.szDescription);
                 sprintf(buf4,"\nSystem status: %s",&ws.szSystemStatus);
                 sprintf(buf5,"\nMaximum Socket: %u",&ws.iMaxSockets);
                 strcat(strcat(strcat(strcat(strcat(strcat(buf,buf1),buf2),buf3),buf4),buf5),buf6);
                 MessageBox(0,buf,"info",0);
                 WSACleanup();
                 return 0;
    }

    i am using windows7 and dev c compiler bt this prog is not compiling please help me this prog is just to make socket
     
    Last edited by a moderator: Oct 7, 2011
  2. xpi0t0s

    xpi0t0s Mentor

    "not compiling" is no help at all. It gives us no clue what might be wrong. What errors do you get? Copy and paste the top five *exactly* and this might help.
     

Share This Page