ÒýÑÔ
×î½ü±ÊÕßÒ»Ö±ÔÚ×öJPEGµÄ½âÂ빤×÷£¬·¢ÏÖÓÃÍêȫʹÓùþ·òÂüÊ÷½øÐнâÂë±È½Ï·Ñʱ£¬¶øʹÓñí½á¹¹´æ´¢±àÂëºÍÖµµÄ¶ÔÓ¦¹Øϵ±È½Ï¿ì½Ý£¬µ«ÊÇÒ²´æÔڱȽÏÄÑ´¦ÀíµÄµØ·½£¬±ÈÈç½âÂ빤×÷ͨ³£ÊÇÒÔλΪµ¥Î»µÄ²Ù×÷£¬ÕâÀï±ØÈ»»áÉæ¼°µ½ÒÆλ²Ù×÷£¬¶ø±ÊÕß֮ǰ¶ÔλµÄ²Ù×÷ºÜÉÙ£¬¾ÑéºÜǷȱ£¬¾¹ýÕâ´ÎÀúÁ·ÖÕÓÚ·¢ÏÖÁËÒ»¸ö×Ô¼ºÔø¾ºöÊӵĶ«Î÷£¬ÄǾÍÊÇC/C++ÖеÄÒÆλ²Ù×÷ÈÝÒ׳ö´íµÄÇé¿ö¡£
1¡¢Ê²Ã´ÑùµÄÊý¾ÝÀàÐÍ¿ÉÒÔÖ±½ÓÒÆλ
char¡¢short¡¢int¡¢long¡¢unsigned char¡¢unsigned short¡¢unsigned int¡¢unsigned long¶¼¿ÉÒÔ½øÐÐÒÆλ²Ù×÷£¬¶ødouble¡¢float¡¢bool¡¢long doubleÔò²»¿ÉÒÔ½øÐÐÒÆλ²Ù×÷¡£
2¡¢ÓзûºÅÊý¾ÝÀàÐ͵ÄÒÆλ²Ù×÷
¶ÔÓÚchar¡¢short¡¢int¡¢longÕâЩÓзûºÅµÄÊý¾ÝÀàÐÍ£º
¶Ô¸ºÊý½øÐÐ×óÒÆ£º·ûºÅλʼÖÕΪ1£¬ÆäËûλ×óÒÆ
¶ÔÕýÊý½øÐÐ×óÒÆ£ºËùÓÐλ×óÒÆ£¬¼´ <<£¬¿ÉÄÜ»á±ä³É¸ºÊý
¶Ô¸ºÊý½øÐÐÓÒÒÆ£ºÈ¡¾ø¶ÔÖµ£¬È»ºóÓÒÒÆ£¬ÔÙÈ¡Ïà·´Êý
¶ÔÕýÊý½øÐÐÓÒÒÆ£ºËùÓÐλÓÒÒÆ£¬¼´ >>
3¡¢ÎÞ·ûºÅÊý¾ÝÀàÐ͵ÄÒÆλ²Ù×÷
¶ÔÓÚunsigned char¡¢unsigned short¡¢unsigned int¡¢unsigned longÕâЩÎÞ·ûºÅÊý¾ÝÀàÐÍ£º
ûÓÐÌØÊâҪ˵Ã÷µÄ£¬Ê¹ÓÃ<< ºÍ >> ²Ù×÷·û¾ÍOKÁË
½áÊøÓï
8086 ÖдæÔÚÂß¼ÒÆλ¡ ......
ÒýÑÔ
×î½ü±ÊÕßÒ»Ö±ÔÚ×öJPEGµÄ½âÂ빤×÷£¬·¢ÏÖÓÃÍêȫʹÓùþ·òÂüÊ÷½øÐнâÂë±È½Ï·Ñʱ£¬¶øʹÓñí½á¹¹´æ´¢±àÂëºÍÖµµÄ¶ÔÓ¦¹Øϵ±È½Ï¿ì½Ý£¬µ«ÊÇÒ²´æÔڱȽÏÄÑ´¦ÀíµÄµØ·½£¬±ÈÈç½âÂ빤×÷ͨ³£ÊÇÒÔλΪµ¥Î»µÄ²Ù×÷£¬ÕâÀï±ØÈ»»áÉæ¼°µ½ÒÆλ²Ù×÷£¬¶ø±ÊÕß֮ǰ¶ÔλµÄ²Ù×÷ºÜÉÙ£¬¾ÑéºÜǷȱ£¬¾¹ýÕâ´ÎÀúÁ·ÖÕÓÚ·¢ÏÖÁËÒ»¸ö×Ô¼ºÔø¾ºöÊӵĶ«Î÷£¬ÄǾÍÊÇC/C++ÖеÄÒÆλ²Ù×÷ÈÝÒ׳ö´íµÄÇé¿ö¡£
1¡¢Ê²Ã´ÑùµÄÊý¾ÝÀàÐÍ¿ÉÒÔÖ±½ÓÒÆλ
char¡¢short¡¢int¡¢long¡¢unsigned char¡¢unsigned short¡¢unsigned int¡¢unsigned long¶¼¿ÉÒÔ½øÐÐÒÆλ²Ù×÷£¬¶ødouble¡¢float¡¢bool¡¢long doubleÔò²»¿ÉÒÔ½øÐÐÒÆλ²Ù×÷¡£
2¡¢ÓзûºÅÊý¾ÝÀàÐ͵ÄÒÆλ²Ù×÷
¶ÔÓÚchar¡¢short¡¢int¡¢longÕâЩÓзûºÅµÄÊý¾ÝÀàÐÍ£º
¶Ô¸ºÊý½øÐÐ×óÒÆ£º·ûºÅλʼÖÕΪ1£¬ÆäËûλ×óÒÆ
¶ÔÕýÊý½øÐÐ×óÒÆ£ºËùÓÐλ×óÒÆ£¬¼´ <<£¬¿ÉÄÜ»á±ä³É¸ºÊý
¶Ô¸ºÊý½øÐÐÓÒÒÆ£ºÈ¡¾ø¶ÔÖµ£¬È»ºóÓÒÒÆ£¬ÔÙÈ¡Ïà·´Êý
¶ÔÕýÊý½øÐÐÓÒÒÆ£ºËùÓÐλÓÒÒÆ£¬¼´ >>
3¡¢ÎÞ·ûºÅÊý¾ÝÀàÐ͵ÄÒÆλ²Ù×÷
¶ÔÓÚunsigned char¡¢unsigned short¡¢unsigned int¡¢unsigned longÕâЩÎÞ·ûºÅÊý¾ÝÀàÐÍ£º
ûÓÐÌØÊâҪ˵Ã÷µÄ£¬Ê¹ÓÃ<< ºÍ >> ²Ù×÷·û¾ÍOKÁË
½áÊøÓï
8086 ÖдæÔÚÂß¼ÒÆλ¡ ......
1.±¾ÕÂ˼άµ¼Í¼£º
Example1:
char
*strcpy(char *target, const char *source) {
char *t = target;
// Copy the contents of source into target.
while(*source) *target++ = *source++;
// Null-terminate the
target.
*target = '\0';
// Return pointer to the
start of target.
return t;
}
Example2:
void
*memmove(void *target, const void *source, size_t count)
Õâ¸öº¯Êý¼´Ê¹
ÊÇÔÚÔ´ºÍÄ¿µÄ×Ö·û´®ÓÐËùÖصþʱ²Ù×÷Ò²Äܳɹ¦£¬ËäÈ»sourceΪconst£¬µ«ÊÇÆäÖ¸ÏòµÄarrayÒ²¿ÉÄܱ»Ð޸ġ£
2.
CÐÍ×Ö·û´®²Ù×÷ʵÀý£º
Ex1.»ù±¾²Ù×÷
/*
*
=====================================================================================
*
* Filename: 2-1.cpp
*
*
Description: Fundamental Operations in C Type String
*
*
Version: 1.0
*  ......
1.±¾ÕÂ˼άµ¼Í¼£º
Example1:
char
*strcpy(char *target, const char *source) {
char *t = target;
// Copy the contents of source into target.
while(*source) *target++ = *source++;
// Null-terminate the
target.
*target = '\0';
// Return pointer to the
start of target.
return t;
}
Example2:
void
*memmove(void *target, const void *source, size_t count)
Õâ¸öº¯Êý¼´Ê¹
ÊÇÔÚÔ´ºÍÄ¿µÄ×Ö·û´®ÓÐËùÖصþʱ²Ù×÷Ò²Äܳɹ¦£¬ËäÈ»sourceΪconst£¬µ«ÊÇÆäÖ¸ÏòµÄarrayÒ²¿ÉÄܱ»Ð޸ġ£
2.
CÐÍ×Ö·û´®²Ù×÷ʵÀý£º
Ex1.»ù±¾²Ù×÷
/*
*
=====================================================================================
*
* Filename: 2-1.cpp
*
*
Description: Fundamental Operations in C Type String
*
*
Version: 1.0
*  ......
1.ÒýÑÔ
¡¡¡¡±¾ÎĵÄд×÷Ä¿µÄ²¢²»ÔÚÓÚÌṩC/C++³ÌÐòÔ±ÇóÖ°ÃæÊÔÖ¸µ¼£¬¶øÖ¼ÔÚ´Ó¼¼ÊõÉÏ·ÖÎöÃæÊÔÌâµÄÄÚº¡£ÎÄÖеĴó¶àÊýÃæÊÔÌâÀ´×Ô¸÷´óÂÛ̳£¬²¿·ÖÊÔÌâ½â´ðÒ²²Î¿¼ÁËÍøÓѵÄÒâ¼û¡£
¡¡¡¡Ðí¶àÃæÊÔÌâ¿´ËƼòµ¥£¬È´ÐèÒªÉîºñµÄ»ù±¾¹¦²ÅÄܸø³öÍêÃÀµÄ½â´ð¡£ÆóÒµÒªÇóÃæÊÔÕßдһ¸ö×î¼òµ¥µÄstrcpyº¯Êý¶¼¿É¿´³öÃæÊÔÕßÔÚ¼¼ÊõÉϾ¿¾¹´ïµ½ÁËÔõÑùµÄ³Ì¶È£¬ÎÒÃÇÄÜÕæÕýдºÃÒ»¸östrcpyº¯ÊýÂð£¿ÎÒÃǶ¼¾õµÃ×Ô¼ºÄÜ£¬¿ÉÊÇÎÒÃÇд³öµÄstrcpyºÜ¿ÉÄÜÖ»ÄÜÄõ½10·ÖÖеÄ2·Ö¡£¶ÁÕß¿É´Ó±¾ÎÄ¿´µ½strcpyº¯Êý´Ó2·Öµ½10·Ö½â´ðµÄÀý×Ó£¬¿´¿´×Ô¼ºÊôÓÚʲôÑùµÄ²ã´Î¡£´ËÍ⣬»¹ÓÐһЩÃæÊÔÌ⿼²éÃæÊÔÕßÃô½ÝµÄ˼άÄÜÁ¦¡£
¡¡¡¡·ÖÎöÕâЩÃæÊÔÌ⣬±¾Éí°üº¬ºÜÇ¿µÄȤζÐÔ£»¶ø×÷ΪһÃûÑз¢ÈËÔ±£¬Í¨¹ý¶ÔÕâЩÃæÊÔÌâµÄÉîÈëÆÊÎöÔò¿É½øÒ»²½ÔöÇ¿×ÔÉíµÄÄÚ¹¦¡£
¡¡¡¡2.ÕÒ´íÌâ
¡¡¡¡ÊÔÌâ1£º
void test1()
{
¡¡char string[10];
¡¡char* str1 = "0123456789";
¡¡strcpy( string, str1 );
}
¡¡¡¡ÊÔÌâ2£º
void test2()
{
¡¡char string[10], str1[10];
¡¡int i;
¡¡for(i=0; i<10; i++)
¡¡{
¡¡¡¡str1[i] = 'a';
¡¡}
¡¡strcpy( string, str1 );
}
¡¡¡¡ÊÔÌâ3£º
void test3(char* str1)
{
¡¡char string[10];
¡¡if( strlen( str ......
1.ÒýÑÔ
¡¡¡¡±¾ÎĵÄд×÷Ä¿µÄ²¢²»ÔÚÓÚÌṩC/C++³ÌÐòÔ±ÇóÖ°ÃæÊÔÖ¸µ¼£¬¶øÖ¼ÔÚ´Ó¼¼ÊõÉÏ·ÖÎöÃæÊÔÌâµÄÄÚº¡£ÎÄÖеĴó¶àÊýÃæÊÔÌâÀ´×Ô¸÷´óÂÛ̳£¬²¿·ÖÊÔÌâ½â´ðÒ²²Î¿¼ÁËÍøÓѵÄÒâ¼û¡£
¡¡¡¡Ðí¶àÃæÊÔÌâ¿´ËƼòµ¥£¬È´ÐèÒªÉîºñµÄ»ù±¾¹¦²ÅÄܸø³öÍêÃÀµÄ½â´ð¡£ÆóÒµÒªÇóÃæÊÔÕßдһ¸ö×î¼òµ¥µÄstrcpyº¯Êý¶¼¿É¿´³öÃæÊÔÕßÔÚ¼¼ÊõÉϾ¿¾¹´ïµ½ÁËÔõÑùµÄ³Ì¶È£¬ÎÒÃÇÄÜÕæÕýдºÃÒ»¸östrcpyº¯ÊýÂð£¿ÎÒÃǶ¼¾õµÃ×Ô¼ºÄÜ£¬¿ÉÊÇÎÒÃÇд³öµÄstrcpyºÜ¿ÉÄÜÖ»ÄÜÄõ½10·ÖÖеÄ2·Ö¡£¶ÁÕß¿É´Ó±¾ÎÄ¿´µ½strcpyº¯Êý´Ó2·Öµ½10·Ö½â´ðµÄÀý×Ó£¬¿´¿´×Ô¼ºÊôÓÚʲôÑùµÄ²ã´Î¡£´ËÍ⣬»¹ÓÐһЩÃæÊÔÌ⿼²éÃæÊÔÕßÃô½ÝµÄ˼άÄÜÁ¦¡£
¡¡¡¡·ÖÎöÕâЩÃæÊÔÌ⣬±¾Éí°üº¬ºÜÇ¿µÄȤζÐÔ£»¶ø×÷ΪһÃûÑз¢ÈËÔ±£¬Í¨¹ý¶ÔÕâЩÃæÊÔÌâµÄÉîÈëÆÊÎöÔò¿É½øÒ»²½ÔöÇ¿×ÔÉíµÄÄÚ¹¦¡£
¡¡¡¡2.ÕÒ´íÌâ
¡¡¡¡ÊÔÌâ1£º
void test1()
{
¡¡char string[10];
¡¡char* str1 = "0123456789";
¡¡strcpy( string, str1 );
}
¡¡¡¡ÊÔÌâ2£º
void test2()
{
¡¡char string[10], str1[10];
¡¡int i;
¡¡for(i=0; i<10; i++)
¡¡{
¡¡¡¡str1[i] = 'a';
¡¡}
¡¡strcpy( string, str1 );
}
¡¡¡¡ÊÔÌâ3£º
void test3(char* str1)
{
¡¡char string[10];
¡¡if( strlen( str ......
ÓÐЩÍøÓѾ³£Ñ¯ÎÊ£ºÔÚVC++ÖÐÈçºÎ·ÃÎÊjavascriptÖеĶÔÏ󡢺¯Êý¡¢±äÁ¿µÈÔªËØ£¿
ÕâÀï°ÑÒÔÇ°·¢±íµÄһϵÁÐÎÄÕ¼¯ÖÐÔÚÒ»Æ𣬷½±ã²éÔÄ¡£
vc++·ÃÎÊjavascript(1)--windowÔڽű¾ÒýÇæÖеÄ×÷ÓÃ
http://blog.csdn.net/pimshell/archive/2008/08/02/2758863.aspx
vc++·ÃÎÊjavascript(2)--IDispatchExÊǶ¯Ì¬½Å±¾ÓïÑԵĻù´¡
http://blog.csdn.net/pimshell/archive/2008/08/04/2768182.aspx
vc++·ÃÎÊjavascript(3)--±éÀújavascriptÖеÄÊý×é
http://blog.csdn.net/pimshell/archive/2008/08/04/2768206.aspx
vc++·ÃÎÊjavascript(4)--ÔÀ´º¯ÊýÒ²ÊǶÔÏó
http://blog.csdn.net/pimshell/archive/2008/08/05/2772413.aspx
vc++·ÃÎÊjavascript(5)--°ó¶¨ÍøÒ³ÔªËصÄʼþ
http://blog.csdn.net/pimshell/archive/2008/08/05/2773717.aspx
vb°ãµÄVC++¿ª·¢(1)--ÒýÑÔ
http://blog.csdn.net/pimshell/archive/2008/07/23/2699046.aspx
vb°ãµÄVC++¿ª·¢(2)--COMÒì³£Óësafecall
http://blog.csdn.net/pimshell/archive/2008/07/24/2704344.aspx
vb°ãµÄVC++¿ª·¢(3)--#import
http://blog.csdn.net/pimshell/archive/2008/07/24/2705663.aspx
vb°ãµÄVC++¿ª·¢(4)--µ÷ÓÃIDispatc ......
ÓÐЩÍøÓѾ³£Ñ¯ÎÊ£ºÔÚVC++ÖÐÈçºÎ·ÃÎÊjavascriptÖеĶÔÏ󡢺¯Êý¡¢±äÁ¿µÈÔªËØ£¿
ÕâÀï°ÑÒÔÇ°·¢±íµÄһϵÁÐÎÄÕ¼¯ÖÐÔÚÒ»Æ𣬷½±ã²éÔÄ¡£
vc++·ÃÎÊjavascript(1)--windowÔڽű¾ÒýÇæÖеÄ×÷ÓÃ
http://blog.csdn.net/pimshell/archive/2008/08/02/2758863.aspx
vc++·ÃÎÊjavascript(2)--IDispatchExÊǶ¯Ì¬½Å±¾ÓïÑԵĻù´¡
http://blog.csdn.net/pimshell/archive/2008/08/04/2768182.aspx
vc++·ÃÎÊjavascript(3)--±éÀújavascriptÖеÄÊý×é
http://blog.csdn.net/pimshell/archive/2008/08/04/2768206.aspx
vc++·ÃÎÊjavascript(4)--ÔÀ´º¯ÊýÒ²ÊǶÔÏó
http://blog.csdn.net/pimshell/archive/2008/08/05/2772413.aspx
vc++·ÃÎÊjavascript(5)--°ó¶¨ÍøÒ³ÔªËصÄʼþ
http://blog.csdn.net/pimshell/archive/2008/08/05/2773717.aspx
vb°ãµÄVC++¿ª·¢(1)--ÒýÑÔ
http://blog.csdn.net/pimshell/archive/2008/07/23/2699046.aspx
vb°ãµÄVC++¿ª·¢(2)--COMÒì³£Óësafecall
http://blog.csdn.net/pimshell/archive/2008/07/24/2704344.aspx
vb°ãµÄVC++¿ª·¢(3)--#import
http://blog.csdn.net/pimshell/archive/2008/07/24/2705663.aspx
vb°ãµÄVC++¿ª·¢(4)--µ÷ÓÃIDispatc ......
ÉÏÖÜÀÏ°å·ÖÏÂÀ´6¸öְλÈí¼þ¿ª·¢·½ÃæµÄְλ¸øÎÒ£¬ÒªÎÒ°´Ö°Î»ÒªÇóÑ°ÕÒºÏÊʵÄÈ˲š£¾ÓÈ»ÊÇC/C++!¾ÝÎÒËùÖª£¬ÔÚÈ˲ſâÖУ¬JAVA È˲ŵ¹ÊÇÓ¦Óо¡ÓУ¬Ñ§CµÄ£¬»¹ÊÇǶÈëʽ¿ª·¢µÄ¿ÉÕæµÄºÃÉÙ°¡¡£ÎÒÓÖ²»ÊÇŮ洣¬ÄѵÀÎÒ»áÔìÈ˲Åô£¿ÒªÇóÌõ¼þ»¹Õâô¸ß£¡
ÒÔÏÂÊÇ´óÁ¬Èí¼þÔ°¼¸¼ÒÖªÃûÍâÆóίÍÐÎÒÃÇÕÐƸµÄְλÐÅÏ¢¡£
Position 1 Èí¼þ¿ª·¢¹¤³Ìʦ
ְλÄÚÈÝ£º ÐèÇó·ÖÎö£¬Éè¼Æ£¬±àÂë²âÊÔµÈ
ְλҪÇó£º Õý¹æ´óѧ±¾¿ÆÒÔÉÏ¡£
¾«Í¨CÓïÑÔ£¬ÈçÓÐC++£¬JAVAµÈ¾Ñé¸ü¼Ñ¡£
ÓÅÏÈÌõ¼þ£º Çý¶¯¿ª·¢¾ÑéÕß¡£
µç×ӻط£¬Î¢»úµÈHW֪ʶ¡£
ÓÐÀûÓÃOS(Linux/QNX/iTron)½øÐпª·¢µÄ¾ÑéÕß¡£
ÈÕÓï3¼¶ÒÔÉÏÕß¡£
Position 2 Èí¼þ¿ª·¢team leader
ְλÄÚÈÝ£º ÒÔÉÏְλÍŶӵĹÜÀí¡£
ְλҪÇó£º Õý¹æ´óѧ±¾¿ÆÒÔÉÏ¡£
& ......
ÉÏÖÜÀÏ°å·ÖÏÂÀ´6¸öְλÈí¼þ¿ª·¢·½ÃæµÄְλ¸øÎÒ£¬ÒªÎÒ°´Ö°Î»ÒªÇóÑ°ÕÒºÏÊʵÄÈ˲š£¾ÓÈ»ÊÇC/C++!¾ÝÎÒËùÖª£¬ÔÚÈ˲ſâÖУ¬JAVA È˲ŵ¹ÊÇÓ¦Óо¡ÓУ¬Ñ§CµÄ£¬»¹ÊÇǶÈëʽ¿ª·¢µÄ¿ÉÕæµÄºÃÉÙ°¡¡£ÎÒÓÖ²»ÊÇŮ洣¬ÄѵÀÎÒ»áÔìÈ˲Åô£¿ÒªÇóÌõ¼þ»¹Õâô¸ß£¡
ÒÔÏÂÊÇ´óÁ¬Èí¼þÔ°¼¸¼ÒÖªÃûÍâÆóίÍÐÎÒÃÇÕÐƸµÄְλÐÅÏ¢¡£
Position 1 Èí¼þ¿ª·¢¹¤³Ìʦ
ְλÄÚÈÝ£º ÐèÇó·ÖÎö£¬Éè¼Æ£¬±àÂë²âÊÔµÈ
ְλҪÇó£º Õý¹æ´óѧ±¾¿ÆÒÔÉÏ¡£
¾«Í¨CÓïÑÔ£¬ÈçÓÐC++£¬JAVAµÈ¾Ñé¸ü¼Ñ¡£
ÓÅÏÈÌõ¼þ£º Çý¶¯¿ª·¢¾ÑéÕß¡£
µç×ӻط£¬Î¢»úµÈHW֪ʶ¡£
ÓÐÀûÓÃOS(Linux/QNX/iTron)½øÐпª·¢µÄ¾ÑéÕß¡£
ÈÕÓï3¼¶ÒÔÉÏÕß¡£
Position 2 Èí¼þ¿ª·¢team leader
ְλÄÚÈÝ£º ÒÔÉÏְλÍŶӵĹÜÀí¡£
ְλҪÇó£º Õý¹æ´óѧ±¾¿ÆÒÔÉÏ¡£
& ......
ͨÐÅ
Server£º
#pragma comment(lib, "ws2_32.lib")
#include <Winsock2.h>
#include <stdio.h>
void main()
{
//°æ±¾ÐÉÌ
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD(1,1); //0x0101
err = WSAStartup(wVersionRequested,&wsaData);
if(err!=0)
{
return 0;
}
if(LOBYTE(wsaData.wVersion)!=1 || HIBYTE(wsaData.wVersion)!=1) //wsaData.wVersion!=0x0101
{
WSACleanup();
return 0;
}
//´´½¨Socket
SOCKET sockSvr = socket(AF_INET,SOCK_STREAM,0);
//´´½¨IPµØÖ·ºÍ¶Ë¿Ú
SOCKADDR_IN addrSvr;
addrSvr.sin_addr.S_un.S_addr = htonl(INADDR_ANY);
addrSvr.sin_family = AF_INET;
addrSvr.sin_port = htons(6000);
//°ó¶¨¶Ë¿Ú¼àÌý
bind(sockSvr,(SOCKADDR*)&addrSvr,sizeof(SOCKADDR));
listen(sockSvr,5);
sockaddr_in addrClient;
int len ......
ͨÐÅ
Server£º
#pragma comment(lib, "ws2_32.lib")
#include <Winsock2.h>
#include <stdio.h>
void main()
{
//°æ±¾ÐÉÌ
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD(1,1); //0x0101
err = WSAStartup(wVersionRequested,&wsaData);
if(err!=0)
{
return 0;
}
if(LOBYTE(wsaData.wVersion)!=1 || HIBYTE(wsaData.wVersion)!=1) //wsaData.wVersion!=0x0101
{
WSACleanup();
return 0;
}
//´´½¨Socket
SOCKET sockSvr = socket(AF_INET,SOCK_STREAM,0);
//´´½¨IPµØÖ·ºÍ¶Ë¿Ú
SOCKADDR_IN addrSvr;
addrSvr.sin_addr.S_un.S_addr = htonl(INADDR_ANY);
addrSvr.sin_family = AF_INET;
addrSvr.sin_port = htons(6000);
//°ó¶¨¶Ë¿Ú¼àÌý
bind(sockSvr,(SOCKADDR*)&addrSvr,sizeof(SOCKADDR));
listen(sockSvr,5);
sockaddr_in addrClient;
int len ......