´´½¨ÖîÈç "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;
}
Ïà¹ØÎĵµ£º
ת£ºhttp://school.ogdev.net/ArticleShow.asp?categoryid=10&id=6019
º¯ÊýÖ¸ÕëÊý×éµÄÃîÓÃ
±ÊÕßÔÚ¿ª·¢Ä³Èí¼þ¹ý³ÌÖÐÓöµ½ÕâÑùÒ»¸öÎÊÌ⣬ǰ¼¶Ä£¿é´«¸øÎÒ¶þ½øÖÆÊý¾Ý£¬ÊäÈë²ÎÊýΪ char* bufferºÍ int length£¬bufferÊÇÊý¾ÝµÄÊ×µØÖ·£¬length±íʾÕâÅúÊý¾ÝµÄ³¤¶È¡£Êý¾ÝµÄÌØµãÊÇ£º³¤¶È²»¶¨£¬ÀàÐͲ»¶¨£¬ÓɵÚÒ»¸ö×Ö½Ú£¨buffer[0] ......
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 ......
This is Edition 2.2.10 of `The `indent' Manual', for Indent Version
2.2.10, last updated 23 July 2008.
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 Free Software
Foundation, Inc. Copyright (C) 1995, 1996 Joseph Arceneaux. Copyright
(C) 1999 Carlo Wood. Copyright (C) 2001 David Ingamell ......
1.ÒýÑÔ ±¾ÎĵÄд×÷Ä¿µÄ²¢²»ÔÚÓÚÌṩC/C++³ÌÐòÔ±ÇóÖ°ÃæÊÔÖ¸µ¼£¬¶øÖ¼ÔÚ´Ó¼¼ÊõÉÏ·ÖÎöÃæÊÔÌâµÄÄÚº¡£ÎÄÖеĴó¶àÊýÃæÊÔÌâÀ´×Ô¸÷´óÂÛ̳£¬²¿·ÖÊÔÌâ½â´ðÒ²²Î¿¼ÁËÍøÓѵÄÒâ¼û-¡£
Ðí¶àÃæÊÔÌâ¿´ËÆ¼òµ¥£¬È´ÐèÒªÉîºñµÄ»ù±¾¹¦²ÅÄܸø³öÍêÃÀµÄ½â´ð¡£ÆóÒµÒªÇóÃæÊÔÕßдһ¸ö×î¼òµ¥µÄstrcpyº¯Êý¶¼¿É¿´³öÃæÊÔÕßÔÚ¼¼ÊõÉϾ¿¾¹´ïµ½ÁËÔ ......
VCÖÐÏÂÃæ¼¸¸ö½á¹¹Ìå´óС·Ö±ðÊǶàÉÙÄØ
struct MyStruct
{
double m4;
char m1;
int m3£»
};
struct MyStruct {
  ......