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

C/C++Ó﷨֪ʶ£ºtypedef struct Ó÷¨Ïê½â

µÚһƪ£ºtypedef structÓëstructµÄÇø±ð
1. »ù±¾½âÊÍ
typedefΪCÓïÑԵĹؼü×Ö£¬×÷ÓÃÊÇΪһÖÖÊý¾ÝÀàÐͶ¨ÒåÒ»¸öÐÂÃû×Ö¡£ÕâÀïµÄÊý¾ÝÀàÐÍ°üÀ¨ÄÚ²¿Êý¾ÝÀàÐÍ£¨int,charµÈ£©ºÍ×Ô¶¨ÒåµÄÊý¾ÝÀàÐÍ
£¨structµÈ£©¡£
ÔÚ±à³ÌÖÐʹÓÃtypedefÄ¿µÄÒ»°ãÓÐÁ½¸ö£¬Ò»¸öÊǸø±äÁ¿Ò»¸öÒ×¼ÇÇÒÒâÒåÃ÷È·µÄÐÂÃû×Ö£¬ÁíÒ»¸öÊǼò»¯Ò»Ð©±È½Ï¸´ÔÓµÄÀàÐÍÉùÃ÷¡£
ÖÁÓÚtypedefÓÐʲô΢ÃîÖ®´¦£¬ÇëÄã½Ó×Å¿´ÏÂÃæ¶Ô¼¸¸öÎÊÌâµÄ¾ßÌå²ûÊö¡£
2. typedef & ½á¹¹µÄÎÊÌâ
µ±ÓÃÏÂÃæµÄ´úÂ붨ÒåÒ»¸ö½á¹¹Ê±£¬±àÒëÆ÷±¨ÁËÒ»¸ö´íÎó£¬ÎªÊ²Ã´ÄØ£¿Äª·ÇCÓïÑÔ²»ÔÊÐíÔڽṹÖаüº¬Ö¸ÏòËü×Ô¼ºµÄÖ¸ÕëÂð£¿ÇëÄãÏȲÂÏëһϣ¬È»ºó¿´ÏÂÎÄ˵
Ã÷£º
typedef struct tagNode
{
¡¡char *pItem;
¡¡pNode pNext;
}
*pNode;
´ð°¸Óë·ÖÎö£º
1¡¢typedefµÄ×î¼òµ¥Ê¹ÓÃ
typedef long byte_4;
¸øÒÑÖªÊý¾ÝÀàÐÍlongÆð¸öÐÂÃû×Ö£¬½Ðbyte_4¡£
2¡¢ typedefÓë½á¹¹½áºÏʹÓÃ
typedef struct tagMyStruct
{
¡¡int iNum;
¡¡long lLength;
}
MyStruct;
ÕâÓï¾äʵ¼ÊÉÏÍê³ÉÁ½¸ö²Ù×÷£º
1) ¶¨ÒåÒ»¸öеĽṹÀàÐÍ
struct tagMyStruct
{
¡¡int iNum;
¡¡long lLength;
};
·ÖÎö£ºtagMyStruct³ÆΪ“tag”£¬¼´“±êÇ©”£¬Êµ¼ÊÉÏÊÇÒ»¸öÁÙʱÃû×Ö£¬struct
¹Ø¼ü×ÖºÍtagMyStructÒ»Æ𣬹¹³ÉÁËÕâ¸ö½á¹¹ÀàÐÍ£¬²»ÂÛÊÇ·ñÓÐtypedef£¬Õâ¸ö½á¹¹¶¼´æÔÚ¡£
ÎÒÃÇ¿ÉÒÔÓÃstruct tagMyStruct varNameÀ´¶¨Òå±äÁ¿£¬µ«Òª×¢Ò⣬ʹÓÃtagMyStruct
varNameÀ´¶¨Òå±äÁ¿ÊDz»¶ÔµÄ£¬ÒòΪstruct ºÍtagMyStructºÏÔÚÒ»Æð²ÅÄܱíʾһ¸ö½á¹¹ÀàÐÍ¡£
2) typedefΪÕâ¸öеĽṹÆðÁËÒ»¸öÃû×Ö£¬½ÐMyStruct¡£
typedef struct tagMyStruct MyStruct;
Òò´Ë£¬MyStructʵ¼ÊÉÏÏ൱ÓÚstruct tagMyStruct£¬ÎÒÃÇ¿ÉÒÔʹÓÃMyStruct varNameÀ´¶¨Òå±äÁ¿¡£
´ð°¸Óë·ÖÎö
CÓïÑÔµ±È»ÔÊÐíÔڽṹÖаüº¬Ö¸ÏòËü×Ô¼ºµÄÖ¸Õ룬ÎÒÃÇ¿ÉÒÔÔÚ½¨Á¢Á´±íµÈÊý¾Ý½á¹¹µÄʵÏÖÉÏ¿´µ½ÎÞÊýÕâÑùµÄÀý×Ó£¬ÉÏÊö´úÂëµÄ¸ù±¾ÎÊÌâÔÚÓÚtypedefµÄ
Ó¦Óá£
¸ù¾ÝÎÒÃÇÉÏÃæµÄ²ûÊö¿ÉÒÔÖªµÀ£ºÐ½ṹ½¨Á¢µÄ¹ý³ÌÖÐÓöµ½ÁËpNextÓòµÄÉùÃ÷£¬ÀàÐÍÊÇpNode£¬ÒªÖªµÀpNode±íʾµÄÊÇÀàÐ͵ÄÐÂÃû×Ö£¬ÄÇôÔÚÀàÐÍ
±¾Éí»¹Ã»Óн¨Á¢Íê³ÉµÄʱºò£¬Õâ¸öÀàÐ͵ÄÐÂÃû×ÖÒ²»¹²»´æÔÚ£¬Ò²¾ÍÊÇ˵Õâ¸öʱºò±àÒëÆ÷¸ù±¾²»ÈÏʶpNode¡£
½â¾öÕâ¸öÎÊÌâµÄ·½·¨ÓжàÖÖ£º
1)¡¢
typedef struct tagNode
{
¡¡char *pItem;
¡¡struct tagNode
*pNext;
} *pNode;
2)¡¢
typedef struct tagNode *pNode;
struct tagNode
{
¡¡c


Ïà¹ØÎĵµ£º

תÔØ:Hadoop Ó¦¸ÃÓÃC++ʵÏÖ£¬¶ø²»ÊÇJava

http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html
Sunday, May 10, 2009
Hadoop should target C++/LLVM, not Java (because of watts)
< type="text/javascript">
digg_url="http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html";
Over the years, ......

C/C++³ÌÐòÔ±±Ø¶ÁµÄÊ®±¾Êé

ÔÚGmail TopLanguage  Group Öп´µ½Ò»ÆªÎÄÕ“C/C++³ÌÐòÔ±±Ø¶ÁµÄÊ®±¾Ê飨ÉÏ£©”£¬´ó¼ÒµÄÌÖÂÛ¶¼ºÜ¼¤Àø£¬´ó¼Ò¶¼¾õµÃÕâƪÎÄÕÂдµÃºÜ°ô£¬ÎÒÏëÔÚGroupÀïµÄÅóÓѶ¼ÄÜÔÚLookgirlµÄÕâƪÎÄÕÂÀï»ñÒæ²»ÉÙ£¬Îª´Ë¶·µ¨ÔÚ´ËתÔظÃÎÄ£¬¹©¸ü¶àÅóÓѽ»Á÷¡¢Ñ§Ï°¡£
C/C++³ÌÐòÔ±±Ø¶ÁµÄÊ®±¾Ê飨ÉÏ£©
Õâ¸öÌâÄ¿´óµÄÓÐЩÀëÆ×£¬Êµ»°Ëµ£ ......

¡¾×ª¡¿c´úÂëÓÅ»¯


1¡¢Ñ¡ÔñºÏÊʵÄËã·¨ºÍÊý¾Ý½á¹¹
Ñ¡ÔñÒ»ÖÖºÏÊʵÄÊý¾Ý½á¹¹ºÜÖØÒª£¬Èç¹ûÔÚÒ»¶ÑËæ»ú´æ·ÅµÄÊýÖÐʹÓÃÁË´óÁ¿µÄ²åÈëºÍɾ³ýÖ¸ÁÄÇʹÓÃÁ´±íÒª¿ìµÃ¶à¡£Êý×éÓëÖ¸ÕëÓï¾ä¾ßÓÐÊ®·ÖÃÜÇеĹØϵ£¬Ò»°ãÀ´Ëµ£¬Ö¸Õë±È½ÏÁé»î¼ò½à£¬¶øÊý×éÔò±È½ÏÖ±¹Û£¬ÈÝÒ×Àí½â¡£¶ÔÓڴ󲿷ֵıàÒëÆ÷£¬Ê¹ÓÃÖ¸Õë±ÈʹÓÃÊý×éÉú³ÉµÄ´úÂë¸ü¶Ì£¬Ö´ÐÐЧÂʸü¸ß¡£
ÔÚÐí¶à ......

¡¾C\C++ÓïÑÔÈëÃÅƪ¡¿ Îļþ²Ù×÷(תÌû)

×î½üʵÔÚÊÇ̫æÁË£¬ÕâƪÕûÕû¾ÍÍƳÙÁË1¸öÔÂÁË£¬ÊµÔÚÊǶԲ»Æð¡£Ö®Ç°±¾´òËãÕâ¸öÄ£¿é¾Í½áÊøÁË£¬Îļþ²Ù×÷¾Í²»Ð´ÁË£¬µ«ÊÇÎļþ²Ù×÷ÓÖÊÇÒ»¸öºÜÖØÒªµÄ¶«Î÷£¬¶øÇÒÒ²¸ÕºÃÄܹ»×ܽá֮ǰÎÒÃÇѧϰµÄËùÓÐ֪ʶ¡£Í¬Ê±Ò²ÎªÁ˽«Îļþ²Ù×÷Õâ¸ö³õѧÕßÈÏΪºÜÉñÃصĶ«Î÷¸ø±¾ÖÊ»¯¡£Òò´Ë£¬±¾Æª½«ÖðÒ»½éÉÜCÓïÑÔµÄÎļþ²Ù×÷¡££¨±¾Ä£¿éµÄÃüÃû±¾À´ÊÇÏëC\C++Ò ......

×Ô¼º¶¯ÊÖдһ¸öÅжÏÍøÖ·ºÏ·¨µÄC\C++µÄÕýÔò±í´ïʽ³ÌÐò

#include<stdio.h>
#include<regex.h>
int main(int argc, char** argv)
{
if(IsLegalPage("http://www.baidu.com"))
printf("¸ÃÍøÒ³ºÏ·¨\n");
else printf("¸ÃÍøÒ³²»ºÏ·¨£¡£¡£¡\n");
return 0;
}
/* º¯Êý˵Ã÷£ºÅжÏÍøÒ³ÊÇ·ñºÏ·¨
* ÊäÈë²ÎÊý£ºÐèÒªÅжϵÄÍø ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ