Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C/C++ÓïÑÔstructÉî²ã̽Ë÷

1. structµÄ¾Þ´ó×÷ÓÃ
¡¡¡¡Ãæ¶ÔÒ»¸öÈ˵ĴóÐÍC/C++³ÌÐòʱ£¬Ö»¿´Æä¶ÔstructµÄʹÓÃÇé¿öÎÒÃǾͿÉÒÔ¶ÔÆä±àдÕßµÄ
±à³Ì¾­Ñé½øÐÐÆÀ¹À¡£ÒòΪһ¸ö´óÐ͵ÄC/C++³ÌÐò£¬ÊƱØÒªÉ漰һЩ(ÉõÖÁ´óÁ¿)½øÐÐÊý¾Ý×éºÏ
µÄ½á¹¹Ì壬ÕâЩ½á¹¹Ìå¿ÉÒÔ½«Ô­±¾ÒâÒåÊôÓÚÒ»¸öÕûÌåµÄÊý¾Ý×éºÏÔÚÒ»Æð¡£´ÓijÖ̶ֳÈÉÏÀ´
˵£¬»á²»»áÓÃstruct£¬ÔõÑùÓÃstructÊÇÇø±ðÒ»¸ö¿ª·¢ÈËÔ±ÊÇ·ñ¾ß±¸·á¸»¿ª·¢¾­ÀúµÄ±êÖ¾¡£
¡¡¡¡ÔÚÍøÂçЭÒ顢ͨÐÅ¿ØÖÆ¡¢Ç¶ÈëʽϵͳµÄC/C++±à³ÌÖУ¬ÎÒÃǾ­³£Òª´«Ë͵IJ»ÊǼòµ¥µÄ×Ö
½ÚÁ÷£¨charÐÍÊý×飩£¬¶øÊǶàÖÖÊý¾Ý×éºÏÆðÀ´µÄÒ»¸öÕûÌ壬Æä±íÏÖÐÎʽÊÇÒ»¸ö½á¹¹Ìå¡£
¡¡¡¡¾­Ñé²»×ãµÄ¿ª·¢ÈËÔ±ÍùÍù½«ËùÓÐÐèÒª´«Ë͵ÄÄÚÈÝÒÀ˳Ðò±£´æÔÚcharÐÍÊý×éÖУ¬Í¨¹ýÖ¸
ÕëÆ«ÒƵķ½·¨´«ËÍÍøÂ籨ÎĵÈÐÅÏ¢¡£ÕâÑù×ö±à³Ì¸´ÔÓ£¬Ò׳ö´í£¬¶øÇÒÒ»µ©¿ØÖÆ·½Ê½¼°Í¨ÐÅ
ЭÒéÓÐËù±ä»¯£¬³ÌÐò¾ÍÒª½øÐзdz£Ï¸ÖµÄÐ޸ġ£
¡¡¡¡Ò»¸öÓо­ÑéµÄ¿ª·¢ÕßÔòÁé»îÔËÓýṹÌ壬¾ÙÒ»¸öÀý×Ó£¬¼ÙÉèÍøÂç»ò¿ØÖÆЭÒéÖÐÐèÒª´«
ËÍÈýÖÖ±¨ÎÄ£¬Æä¸ñʽ·Ö±ðΪpacketA¡¢packetB¡¢packetC£º
struct structA
{
int a;
char b;
};
struct structB
{
char a;
short b;
};
struct structC
{
int a;
char b;
float c;
}
¡¡¡¡ÓÅÐãµÄ³ÌÐòÉè¼ÆÕßÕâÑùÉè¼Æ´«Ë͵ı¨ÎÄ£º
struct CommuPacket
{
int iPacketType;¡¡¡¡//±¨ÎÄÀàÐͱêÖ¾
union¡¡¡¡¡¡¡¡¡¡¡¡//ÿ´Î´«Ë͵ÄÊÇÈýÖÖ±¨ÎÄÖеÄÒ»ÖÖ£¬Ê¹ÓÃunion
{
  struct structA packetA;
  struct structB packetB;
  struct structC packetC;
}
};
¡¡¡¡ÔÚ½øÐб¨ÎÄ´«ËÍʱ£¬Ö±½Ó´«ËÍstruct CommuPacketÒ»¸öÕûÌå¡£
¡¡¡¡¼ÙÉè·¢Ëͺ¯ÊýµÄÔ­ÐÎÈçÏ£º
// pSendData£º·¢ËÍ×Ö½ÚÁ÷µÄÊ×µØÖ·£¬iLen£ºÒª·¢Ë͵ij¤¶È
Send(char * pSendData, unsigned int  iLen);
·¢ËÍ·½¿ÉÒÔÖ±½Ó½øÐÐÈçϵ÷Ó÷¢ËÍstruct CommuPacketµÄÒ»¸öʵÀýsendCommuPacket£º
Send( (char *)&sendCommuPacket , sizeof(CommuPacket) );
¼ÙÉè½ÓÊÕº¯ÊýµÄÔ­ÐÎÈçÏ£º
// pRecvData£º·¢ËÍ×Ö½ÚÁ÷µÄÊ×µØÖ·£¬iLen£ºÒª½ÓÊյij¤¶È
//·µ»ØÖµ£ºÊµ¼Ê½ÓÊÕµ½µÄ×Ö½ÚÊý
unsigned int Recv(char * pRecvData, unsigned int  iLen)£»
¡¡¡¡½ÓÊÕ·½¿ÉÒÔÖ±½Ó½øÐÐÈçϵ÷Óý«½ÓÊÕµ½µÄÊý¾Ý±£´æÔÚstruct CommuPacketµÄÒ»¸öʵÀý
recvCommuPacketÖУº
Recv( (char *)&recvCommuPacket , sizeof(CommuPacket) );
¡¡¡¡½Ó×ÅÅжϱ¨ÎÄÀàÐͽøÐÐÏàÓ¦´¦Àí£º
switch(recvCommuPacket. iPacketType)
{
  &nbs


Ïà¹ØÎĵµ£º

×Ô¶¯¸ü¸Ä×ÀÃæ±³¾° c/c++ win32

Õâ¸ö³ÌÐò½ö¹©±à³Ì²Î¿¼
ÈôÏëÔÚƽʱÓã¬ÇëÏÂÔØ΢ÈíµÄwallpaper changer
ÎÒÕâ¸ö³ÌÐòʵÏÖÁ˶¨Ê±¸ü»»×ÀÃæ±³¾°µÄ¹¦ÄÜ
ÃüÁîÐÐ wallpaper "your images' directory path" time_in_minute
±à³ÌÒªµã
findfirstfile findnextfile ²éÕÒͼÏñÎļþ
SystemParametersInfo  ÐÞ¸ÄϵͳÐÅÏ¢£¬ÔÚÕâ¶ùµ±È»ÊÇ×ÀÃæ±³¾°
×¢²á±í²Ù×÷ ±£´æÐ ......

cÏÝÚåÓëȱÏÝ ÐĵÃÌå»á 1

      ½ñÌì±È½ÏÀÁ¶è£¬Ã»×öÌ⣬ֻÊÇ¿´ÁËÒ»µãÄDZ¾cÏÝÚåÓëȱÏÝ£¬ËµÊµ»°¶ÁÁ˲»¶àµ«Ã÷ÏÔÄܸоõ³öÕâÊÇÒ»±¾ºÃÊ飬¸Ð¾õ¶ÔÎÒÀ´Ëµ¸ÕºÃ£¬²»ÊÇ»ù´¡Ê飬µ«Ò²»ù±¾ÄÜ¿´¶®£¬¶øÇÒÄÜѧµ½ºÃ¶à¶«Î÷£¬µ«½ñÌìÖ»¿´ÁËÈýÕ£¬Ö÷ÒªÊÇϾüÆìÁË£¬囧£¬ÎÒÒ²Ö»ÄÜ°ÑÎÒѧµ½µÄ×ܽáÏÂÀ´£¬Ñ§ÁË×ܱÈÒ»µã¶¼Ã»Ñ§ÒªºÃ£¬ÎÒÒ²Ö»ÄÜÕâÑù°²Î¿×Ô¼ºÁË¡£ ......

תÌù C/C++³ÌÐòÔ±³£¼ûÃæÊÔÌâÉîÈëÆÊÎö

1.ÒýÑÔ   ±¾ÎĵÄд×÷Ä¿µÄ²¢²»ÔÚÓÚÌṩC/C++³ÌÐòÔ±ÇóÖ°ÃæÊÔÖ¸µ¼£¬¶øÖ¼ÔÚ´Ó¼¼ÊõÉÏ·ÖÎöÃæÊÔÌâµÄÄÚº­¡£ÎÄÖеĴó¶àÊýÃæÊÔÌâÀ´×Ô¸÷´óÂÛ̳£¬²¿·ÖÊÔÌâ½â´ðÒ²²Î¿¼ÁËÍøÓѵÄÒâ¼û-¡£
 Ðí¶àÃæÊÔÌâ¿´ËƼòµ¥£¬È´ÐèÒªÉîºñµÄ»ù±¾¹¦²ÅÄܸø³öÍêÃÀµÄ½â´ð¡£ÆóÒµÒªÇóÃæÊÔÕßдһ¸ö×î¼òµ¥µÄstrcpyº¯Êý¶¼¿É¿´³öÃæÊÔÕßÔÚ¼¼ÊõÉϾ¿¾¹´ïµ½ÁËÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ