Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : c++

C/C++ ÖеÄÒÆλ²Ù×÷Ê°ÒÅ

ÒýÑÔ
×î½ü±ÊÕßÒ»Ö±ÔÚ×ö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 ÖдæÔÚÂß¼­ÒÆλ¡ ......

C/C++ ÖеÄÒÆλ²Ù×÷Ê°ÒÅ

ÒýÑÔ
×î½ü±ÊÕßÒ»Ö±ÔÚ×ö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 ÖдæÔÚÂß¼­ÒÆλ¡ ......

c/c++ string


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
*  ......

c/c++ string


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
*  ......

C/C++ ³ÌÐòÉè¼ÆԱӦƸ³£¼ûÃæÊÔÊÔÌâÉîÈëÆÊÎö

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 ......

C/C++ ³ÌÐòÉè¼ÆԱӦƸ³£¼ûÃæÊÔÊÔÌâÉîÈëÆÊÎö

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ÖеĶÔÏ󡢺¯Êý¡¢±äÁ¿µÈÔªËØ£¿
ÕâÀï°ÑÒÔÇ°·¢±íµÄһϵÁÐÎÄÕ¼¯ÖÐÔÚÒ»Æ𣬷½±ã²éÔÄ¡£
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ÖеĶÔÏ󡢺¯Êý¡¢±äÁ¿µÈÔªËØ£¿
ÕâÀï°ÑÒÔÇ°·¢±íµÄһϵÁÐÎÄÕ¼¯ÖÐÔÚÒ»Æ𣬷½±ã²éÔÄ¡£
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 ......

C/C++¿ª·¢¾­ÑéÈ˲ÅÇë½ø£¡

ÉÏÖÜÀÏ°å·ÖÏÂÀ´6¸öְλÈí¼þ¿ª·¢·½ÃæµÄְλ¸øÎÒ£¬ÒªÎÒ°´Ö°Î»ÒªÇóÑ°ÕÒºÏÊʵÄÈ˲š£¾ÓÈ»ÊÇC/C++!¾ÝÎÒËùÖª£¬ÔÚÈ˲ſâÖУ¬JAVA È˲ŵ¹ÊÇÓ¦Óо¡ÓУ¬Ñ§CµÄ£¬»¹ÊÇǶÈëʽ¿ª·¢µÄ¿ÉÕæµÄºÃÉÙ°¡¡£ÎÒÓÖ²»ÊÇŮ洣¬ÄѵÀÎÒ»áÔìÈ˲Åô£¿ÒªÇóÌõ¼þ»¹Õâô¸ß£¡
ÒÔÏÂÊÇ´óÁ¬Èí¼þÔ°¼¸¼ÒÖªÃûÍâÆóίÍÐÎÒÃÇÕÐƸµÄְλÐÅÏ¢¡£
Position 1 Èí¼þ¿ª·¢¹¤³Ìʦ
ְλÄÚÈÝ£º ÐèÇó·ÖÎö£¬Éè¼Æ£¬±àÂë²âÊÔµÈ
ְλҪÇó£º Õý¹æ´óѧ±¾¿ÆÒÔÉÏ¡£
                 ¾«Í¨CÓïÑÔ£¬ÈçÓÐC++£¬JAVAµÈ¾­Ñé¸ü¼Ñ¡£
ÓÅÏÈÌõ¼þ£º Çý¶¯¿ª·¢¾­ÑéÕß¡£
                µç×ӻط£¬Î¢»úµÈHW֪ʶ¡£
                ÓÐÀûÓÃOS(Linux/QNX/iTron)½øÐпª·¢µÄ¾­ÑéÕß¡£
                ÈÕÓï3¼¶ÒÔÉÏÕß¡£
Position 2 Èí¼þ¿ª·¢team leader
ְλÄÚÈÝ£º ÒÔÉÏְλÍŶӵĹÜÀí¡£
ְλҪÇó£º Õý¹æ´óѧ±¾¿ÆÒÔÉÏ¡£
 & ......

C/C++¿ª·¢¾­ÑéÈ˲ÅÇë½ø£¡

ÉÏÖÜÀÏ°å·ÖÏÂÀ´6¸öְλÈí¼þ¿ª·¢·½ÃæµÄְλ¸øÎÒ£¬ÒªÎÒ°´Ö°Î»ÒªÇóÑ°ÕÒºÏÊʵÄÈ˲š£¾ÓÈ»ÊÇC/C++!¾ÝÎÒËùÖª£¬ÔÚÈ˲ſâÖУ¬JAVA È˲ŵ¹ÊÇÓ¦Óо¡ÓУ¬Ñ§CµÄ£¬»¹ÊÇǶÈëʽ¿ª·¢µÄ¿ÉÕæµÄºÃÉÙ°¡¡£ÎÒÓÖ²»ÊÇŮ洣¬ÄѵÀÎÒ»áÔìÈ˲Åô£¿ÒªÇóÌõ¼þ»¹Õâô¸ß£¡
ÒÔÏÂÊÇ´óÁ¬Èí¼þÔ°¼¸¼ÒÖªÃûÍâÆóίÍÐÎÒÃÇÕÐƸµÄְλÐÅÏ¢¡£
Position 1 Èí¼þ¿ª·¢¹¤³Ìʦ
ְλÄÚÈÝ£º ÐèÇó·ÖÎö£¬Éè¼Æ£¬±àÂë²âÊÔµÈ
ְλҪÇó£º Õý¹æ´óѧ±¾¿ÆÒÔÉÏ¡£
                 ¾«Í¨CÓïÑÔ£¬ÈçÓÐC++£¬JAVAµÈ¾­Ñé¸ü¼Ñ¡£
ÓÅÏÈÌõ¼þ£º Çý¶¯¿ª·¢¾­ÑéÕß¡£
                µç×ӻط£¬Î¢»úµÈHW֪ʶ¡£
                ÓÐÀûÓÃOS(Linux/QNX/iTron)½øÐпª·¢µÄ¾­ÑéÕß¡£
                ÈÕÓï3¼¶ÒÔÉÏÕß¡£
Position 2 Èí¼þ¿ª·¢team leader
ְλÄÚÈÝ£º ÒÔÉÏְλÍŶӵĹÜÀí¡£
ְλҪÇó£º Õý¹æ´óѧ±¾¿ÆÒÔÉÏ¡£
 & ......

TCP£¨SOCKETS£©±à³Ì C/C++ʵÏÖ

ͨÐÅ
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 ......

TCP£¨SOCKETS£©±à³Ì C/C++ʵÏÖ

ͨÐÅ
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 ......
×ܼǼÊý:969; ×ÜÒ³Êý:162; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [9] [10] [11] [12] 13 [14] [15] [16] [17] [18]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ