char a[20];
    strcpy(a,"1.2.3.4");
    DWORD t=inet_addr(a);
    wspritf("%x",t);
    MessageBox(a);郁闷得到的居然是: 04030201
倒过来了....

解决方案 »

  1.   

    MSDN上说
    When four parts are specified, each is interpreted as a byte of data and assigned, from left to right, to the four bytes of an Internet address. When an Internet address is viewed as a 32-bit integer quantity on the Intel architecture, the bytes referred to above appear as "d.c.b.a''. That is, the bytes on an Intel processor are ordered from right to left.但我想要顺着过来的数字,MFC库或API里有没有现成的函数
      

  2.   

    inet_addr只能把IP地址转换成标一连串数字那种IP地址