´´½¨ÖîÈç "c:\a\b\c\d\yeah.log"Öеĸ÷¼¶Îļþ¼Ð
×î½üά»¤Logger¹²Ïí¿âµÄʱºòÐÂÔöÁ˸üÈËÐÔ»¯µÄ×Ô¶¯´´½¨¸÷¼¶Ä¿Â¼µÄ¹¦ÄÜ£¬ÏÂÃæÊÇÎÒʵÏÖ´´½¨ÖîÈç "c:\a\b\c\d\yeah.log"Öеĸ÷¼¶Îļþ¼ÐµÄ¹ý³Ì£¬Çë´ó¼ÒÖ¸½Ì£¡
BOOL CreateDirectoryInPathW(const wchar_t *sLogPath)
{
static BOOL bRet = 0;
CString csFullDir(_T(""));//Ôʼȫ·¾¶
int nLen = 0;//Ôʼȫ·¾¶³¤¶È
int nIdx = 0;//µ±Ç°“\\”µÄλÖÃ
int nLeft = 0;
CString csLastDir(_T(""));
if (wcslen(sLogPath) > MAX_PATH)
{
OutputDebugString(_T("Failed to create directory.This limit is related to how the CreateDirectory function parses paths\r\n"));
return 0;
}
csFullDir.Format(_T("%s"), sLogPath);
nLen = csFullDir.GetLength();
if (-1 == csFullDir.Find(_T('\\'), 0))
{//²»Óô´½¨Îļþ¼Ð
return 1;
}else if (2 == nIdx)
{//¸ùĿ¼ºöÂÔ
nLeft = nIdx+1;
}
while (1)
{
nIdx = csFullDir.Find(_T('\\'), nLeft);
if (-1 == nIdx)
{
break;
}
nIdx = csFullDir.Right(nLen-nLeft).Find(_T('\\'), 0);
nLeft += nIdx+1;
csLastDir = csFullDir.Left(nLeft);
bRet = CreateDirectory(csLastDir, NULL);
}
return bRet;
}
Ïà¹ØÎĵµ£º
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸е쬻î»î»î£¡
&n ......
Chapter 1: Thread
¢Ù thread functions
1. pthread_self();
2. thread existing
you can get the value of rval_ptr just by pthread_join(pthread_t tht, void ** rval_ptr)
cancel a thread as the thread exits with PTHREAD_CANCELED in pthread_exit, this functio ......
1.
ÒýÑÔ
¡¡¡¡C++
ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”
£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++
ÖÐÀàËÆC
ÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëC
ÓïÑÔÍêÈ«Ïàͬ¡£×÷ ΪһÖÖÓûÓëC
¼æÈݵÄÓïÑÔ£¬C++
±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌØµã£¨±»ÊÀÈ˳ÆÎª“
²»³¹µ×µØÃæÏò¶ÔÏó”
£©£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚ ......
ǶÈëʽϵͳÓÉÓÚÊܹ¦ºÄ¡¢³É±¾ºÍÌå»ýµÈÒòËØµÄÖÆÔ¼£¬Ç¶Èëʽ΢´¦ÀíÆ÷µÄ´¦ÀíÄÜÁ¦Óë×ÀÃæÏµÍ³´¦ÀíÆ÷Ïà±ÈÒ²´æÔڽϴó²î¾à£¬¹ÊǶÈëʽϵͳ¶Ô³ÌÐòÔËÐеĿռäºÍʱ¼äÒªÇó¸üΪ¿Á¿Ì¡£
ͨ³££¬ÐèÒª¶ÔǶÈëʽӦÓóÌÐò½øÐÐÐÔÄÜÓÅ»¯£¬ÒÔÂú×ãǶÈëʽӦÓõÄÐÔÄÜÐèÇó¡£
1 ǶÈëʽ³ÌÐòÓÅ»¯µÄÀàÐÍ
&nbs ......
1. structµÄ¾Þ´ó×÷ÓÃ
¡¡¡¡Ãæ¶ÔÒ»¸öÈ˵ĴóÐÍC/C++³ÌÐòʱ£¬Ö»¿´Æä¶ÔstructµÄʹÓÃÇé¿öÎÒÃǾͿÉÒÔ¶ÔÆä±àдÕßµÄ
±à³Ì¾Ñé½øÐÐÆÀ¹À¡£ÒòΪһ¸ö´óÐ͵ÄC/C++³ÌÐò£¬ÊƱØÒªÉ漰һЩ(ÉõÖÁ´óÁ¿)½øÐÐÊý¾Ý×éºÏ
µÄ½á¹¹Ì壬ÕâЩ½á¹¹Ìå¿ÉÒÔ½«Ô±¾ÒâÒåÊôÓÚÒ»¸öÕûÌåµÄÊý¾Ý×éºÏÔÚÒ»Æð¡£´ÓijÖ̶ֳÈÉÏÀ´
˵£¬»á²»»áÓÃstruct£¬ÔõÑùÓÃstructÊÇÇø± ......