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

´´½¨ÖîÈç "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;
}


Ïà¹ØÎĵµ£º

C/C++ÓïÑÔ±à³ÌÐÞÑø£¨×ª£©

±à³ÌÐÞÑø £¨×÷Õߣº³Â𩣩
————
ת×Ô:http://blog.chinaunix.net/u1/49717/showart.php?id=2138481 
ʲôÊǺõijÌÐòÔ±£¿ÊDz»ÊǶ®µÃºÜ¶à¼¼Êõϸ½Ú£¿»¹ÊǶ®µ×²ã±à³Ì£¿»¹ÊDZà³ÌËٶȱȽϿ죿
ÎÒ¾õµÃ¶¼²»ÊÇ¡£¶ÔÓÚһЩ¼¼Êõϸ½ÚÀ´ËµºÍµ×²ãµÄ¼¼Êõ£¬Ö»Òª¿´°ïÖú£¬²é×ÊÁϾÍÄÜÕÒµ½£¬¶Ô
ÓÚËÙ¶È¿ì£¬Ö ......

Linux Cµ÷ÊÔÈëÃÅ

1.×Ô¶¨ÒåÊä³ö
  Ïë±Ø´ó¼Ò¶¼ÓÐÀûÓÃÊä³öº¯ÊýÈçprintfÀ´°ïÖúÎÒÃǵ÷ÊÔ³ÌÐòµÄ¾­Àú£¬ÕâÊÇÒ»ÖֱȽÏԭʼµÄ³ÌÐòµ÷ÊÔ¸¨Öú·½·¨£¬ÔÚLinuxÏÂÒ²¿ÉÒÔΪÎÒÃÇËùÓᣲ»¹ýÕâÖÖ·½·¨ÓÐÒ»¸öÃ÷ÏÔµÄȱµã£¬¾ÍÊÇÔÚµ÷ÊÔÍêºóÎÒÃDZØÐë×¢ÊÍ»òɾ³ýµôÕâЩ¸¨Öú´úÂë¡£Linux CÌṩÁË-DDEBUGÕâ¸ö±àÒë±ê¼ÇÀ´¶¨ÒåDEBUGÕâ¸ö·ûºÅ£¬½èÖúÓڸ÷ûºÅ£¬ÎÒÃÇ¿ÉÒÔÔÚÓ¦Ó ......

Indent and Format C Program Source(indent manual)

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 ......

¡¾C\C++ÓïÑÔÈëÃÅƪ¡¿ ÉîÈëÖ¸Õë

ÔÙÉÏһƪ£¬ÎÒÃǽéÉÜÁË»ù±¾µ÷ÊÔ¡£Ö®Ç°Ò²ËµÁË£¬Ö®ËùÒ԰ѵ÷ÊÔ·ÅÔÚÇ°Ãæ½²ÊÇÒòΪºóÃæµÄÎÄÕ»ù±¾¶¼»áÓõ½µ÷ÊÔ¡£¹Û²ìÎÒÃǵijÌÐòµ½µ×·¢ÉúÁËʲô¡£ÈÃÎÒÃÇÄܹ»Ö±½ÓÃ÷Á˵Ŀ´Çå³þÎÊÌâµÄ±¾ÖÊ¡£±¾Æª½«ÉîÈëÒ»µã½éÉÜÖ¸ÕëÕâ¸öÈÃÎÞÊý³õѧÕßη¾åµÄ¶«Î÷¡£Ï£Íû´ó¼ÒÔÙ¿´Í걾ƪ֮ºóÄܶÔÖ¸ÕëÓÐеÄÈÏʶ£¬Ö®ºó²»ÔÙ¾åÅÂËü¡£¾õµÃËü¾ÍÄÇô»ØÊ¡£ÄÇÏÂÃæÎÒ ......

C struct ÖÐ×Ö½Ú¶ÔÆëÎÊÌâ


VCÖÐÏÂÃ漸¸ö½á¹¹Ìå´óС·Ö±ðÊǶàÉÙÄØ
struct MyStruct
{
    double m4;
    char m1;
    int  m3£»
};
struct MyStruct {
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ