C runtime lib Ḭ̈߳²È«
ÖÜÎ忪»á×öÍŶӳÉÔ±codereivew£¬ ÓÐͬÊÂÌá³öÁËÒ»¸ö¹ØÓÚgmtime¶àÏß³ÌÊÇ·ñ°²È«µÄÎÊÌ⣬ µ±Ê±¾õµÃ³ÌÐòLinkÁËVCµÄ¶àÏ߳̿⣬Ӧ¸Ã²»ÊÇÎÊÌâ¡£»¹ºÃ»ØÍ·ºËʵÁËһϣ¬·¢ÏÖÁ˾¹ÊÇÒ»¸öDZÔÚµÄbug¡£
³ÌÐò·ÖÔÚapplication£¨Íê³ÉÏîÄ¿Ìض¨¹¦ÄÜ£©ºÍframework£¨¿ÉÖØÓõĺËÐŦÄÜ£©Á½²¿·Ö£¬Ï̵߳ÄÆô¶¯ÓÉframeworkÍê³É¡£ appÖÐʹÓÃÁËgmtime/localtimeµÈC¿âº¯Êý¡£
gmtime/localtimeµÈCº¯ÊýÊÇ·ÇḬ̈߳²È«µÄ£¬Õâ¸önÄêÇ°¾ÍÖªµÀ£¬ Ò²ÖªµÀÔÚWindowsƽ̨ÉÏVCÓÐMT°æ±¾µÄruntime library£¬Í¨¹ýÏ̵߳ľֲ¿´æ´¢£¨TLS£©ÊµÏÖÁË/mt Á´½ÓʱµÄḬ̈߳²È«¡£ È»¶øÏ̵߳ÄÆô¶¯±ØÐëͨ¹ýCÔËÐÐʱ¿âµÄ_beginthreadex, ¶ø²»ÊÇwin32 API CreateThead ¡£²»ÐҵĵÄÊǵ±ÄêframeworkµÄʵÏÖÕßòËƲ»Çå³þ_beginthreadexÓëCreateThreadµÄÇø±ð£¨BTW£¬ Õâ¸öÊǵ±Äê½øÈëµÚÒ»¼Ò¹«Ë¾µÄÒ»µÀÃæÊÔÌ⣬ËùÒÔÓ¡ÏóÆÄΪÉî¿Ì£©£¬Ö±½Óµ÷CreateThreadÆô¶¯ÁËÏ̡߳£
½â¾ö·½°¸µ÷²éÖУ¬VC CRT¾¹ÊÇûÓÐgmtime_r/localtime_r¡£
²Î¿¼×ÊÁÏ£º
http://social.msdn.microsoft.com/forums/en-US/vclanguage/thread/c727ae29-5a7a-42b6-ad0b-f6b21c1180b2
http://www.tech-archive.net/Archive/VC/microsoft.public.vc.language/2006-02/msg00013.html
Ïà¹ØÎĵµ£º
ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØҪʹÓÃÏ̳߳ØÁË¡£
ÏÂÃæÊÇLinuxϵͳÏÂÓÃCÓïÑÔ´´½¨µÄÒ»¸öÏ̳߳ء£Ï̳߳ػ ......
Ò»¡¢C/SģʽÓëB/SģʽµÄ±È½Ï·ÖÎö
¡¡¡¡C/SģʽÖ÷ÒªÓÉ¿Í»§Ó¦ÓóÌÐò(Client)¡¢·þÎñÆ÷¹ÜÀí³ÌÐò(Server)ºÍÖмä¼þ(middleware)Èý¸ö²¿¼þ×é³É¡£¿Í»§Ó¦ÓóÌÐòÊÇϵͳÖÐÓû§ÓëÊý¾Ý½øÐн»»¥µÄ²¿¼þ¡£·þÎñÆ÷³ÌÐò¸ºÔðÓÐЧµØ¹ÜÀíϵͳ×ÊÔ´£¬Èç¹ÜÀíÒ»¸öÐÅÏ¢Êý¾Ý¿â£¬ÆäÖ÷Òª¹¤×÷Êǵ±¶à¸ö¿Í»§²¢·¢µØÇëÇó·þÎñÆ÷ÉϵÄÏàͬ×ÊԴʱ£¬¶ÔÕâЩ×ÊÔ´½øÐÐ×î ......
cÖ¸ÕëµÄÔËËãÓÐʱºò»¹ÊǺÜÃÔ»óÈ˵ġ£
ÀýÈ磺
struct student {
int num;
int score;
int length;
};
struct student *pt;
pt = (struct student *) malloc(sizeof(struct student));
pt->num = 1;
pt->score = 90;
pt->length = 3 * sizeof(int);
printf("pt length:%d\n", *pt);
pt = (int ......
ÒÔTMS320VC5402ΪÀý£¬Ì½ÌÖÒ»ÖÖ×ÛºÏÔËÓÃCÓïÑÔ¡¢Êý¾ÝÎļþ¼°GELÓïÑÔµÄFlash±à³Ìз½·¨¡£
¡¡¡¡¸Ã·½·¨ÍêÈ«²ÉÓÃCÓïÑÔ±àдÉÕд³ÌÐò£¬½â¾öÁËÖ¸Õë²»ÄÜ·ÃÎʸ߶ËFlashµÄÎÊÌâ;°ÑÒýµ¼±í×÷³ÉÊý¾ÝÎļþ£¬¿ÉʵÏÖ´óÒýµ¼±íµÄ·ÖÅú´Î¼ÓÔØ;ͨ¹ýGEL³ÌÐò¿ØÖÆC³ÌÐòÖ´ÐУ¬½ÏºÃµØÌåÏÖÁËFlash±à³ÌµÄÁ÷³Ì¡£
¡¡¡¡ÒýÑÔ
¡¡¡¡ÔÚDSPÓ¦ÓÃϵͳ¿ª·¢µÄºóÆÚ£¬Ò»° ......
Ò»£® ºÎν¿É±ä²ÎÊý
int printf( const char* format, ...);
ÕâÊÇʹÓùýCÓïÑÔµÄÈËËùÔÙÊìϤ²»¹ýµÄprintfº¯ÊýÔÐÍ£¬ËüµÄ²ÎÊýÖоÍÓй̶¨²ÎÊýformatºÍ¿É±ä²ÎÊý£¨Óᱡ¡±±íʾ£©¡£
¶øÎÒÃÇÓÖ¿ÉÒÔÓø÷ÖÖ·½Ê½À´µ÷ÓÃprintf,Èç:
printf("%d",value);
printf("%s",str);
printf("the number is %d ,st ......