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

C/VCĿ¼²Ù×÷


C/VCĿ¼²Ù×÷
Ðdz¾ ·¢±íÓÚ 2006-10-11 15:54:00
0
ÍƼö
Ò»¡¢Ä¿Â¼²Ù×÷º¯Êý½éÉÜ
ÔÚVC++µÄ“direct.h”Öж¨ÒåÁËÒÔÏÂ4¸öº¯Êý£º
int chdir(const char *);       //change directory
char * getcwd(char *, int);  //get current working directory
int mkdir(const char *);      //make directory
int rmdir(const char *);      //remove directory, the directory must be empty
ÔÚʹÓÃÕâЩº¯Êýʱ£¬±ØÐë°üº¬ÈçÏÂÓï¾ä£º
££i nclude <direct.h>
¶þ¡¢º¯ÊýʹÓþÙÀý
void OnMakeDir()
{
 // TODO: Add your control notification handler code here
 CString   m_TempName;  
 m_TempName=_T("e:\\testtmp");                    
 CFileStatus   rStatus;
 if(!CFile::GetStatus(m_TempName,rStatus))
 {
  if(!mkdir(m_TempName))
  {
   MessageBox( "Directory 'e:\\testtmp' was successfully created " );
   if(!rmdir(m_TempName))
    MessageBox( "Directory 'e:\\testtmp' was successfully removed " );
   else
    MessageBox( "Problem removing directory 'e:\\testtmp' " );
  }
  else
  MessageBox( "Problem creating directory 'e:\\testtmp' " );
 }
 else
  MessageBox("e:\\testtmp is exist!");
}
void CTestDlg::OnGetCurWorkingDirect()
{
  char buffer[67];
 if(getcwd(buffer,66) == NULL)
  MessageBox("getcwd error");
 else
  MessageBox(buffer); 
}


Ïà¹ØÎĵµ£º

C/C++»ñÈ¡µ±Ç°ÏµÍ³Ê±¼ä(תÔØ)


// ·½°¸— Óŵ㣺½öʹÓÃC ±ê×¼¿â£»È±µã£ºÖ»Äܾ«È·µ½Ã뼶
#include <time.h>
#include <stdio.h>
int main( void )
{
    time_t t = time(0);
    char tmp[64];
    strftime( tmp, sizeof(tmp), "%Y/%m/%d %X %A ±¾ÄêµÚ%jÌì %z",localtim ......

C/C++»ù±¾±à³Ì¼¼ÄÜ¡¾×ª¡¿

Ò»¡¢ÇëÌîдBOOL , float, Ö¸Õë±äÁ¿ Óë“ÁãÖµ”±È½ÏµÄ if Óï¾ä¡££¨10·Ö£©
Ìáʾ£ºÕâÀï“ÁãÖµ”¿ÉÒÔÊÇ0, 0.0 , FALSE»òÕß“¿ÕÖ¸Õ딡£ÀýÈç int ±äÁ¿ n
Óë“ÁãÖµ”±È½ÏµÄ if Óï¾äΪ£º
if ( n == 0 )
if ( n != 0 )
ÒÔ´ËÀàÍÆ¡£
Çëд³ö BOOL flag Óë“ÁãÖµ”±È½ÏµÄ if ......

C/C++ÖеÄÈÕÆÚºÍʱ¼ä time_tÓëstruct tm

 ±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼Æʱ¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê׼ʱ¼ä£©£¬Calendar Time£¨ÈÕÀúʱ¼ä£©£¬epoch£¨Ê±¼äµã ......

c fopenº¯Êý

[CÓïÑÔ]fopen()º¯ÊýµÄ²ÎÊý˵Ã÷
2007Äê06ÔÂ05ÈÕ ÐÇÆÚ¶þ 23:55
¸ñʽ£ºÎļþÖ¸ÕëÃû=fopen(ÎļþÃû£¬Ê¹ÓÃÎļþ·½Ê½)
²ÎÊý£º
ÎļþÃû ÒâÒå
"C:/temp/temp.txt" Îļþ C:\temp\temp.txt
ÎļþʹÓ÷½Ê½ ¡¡ Òâ Òå
“rt”¡¡¡¡¡¡¡¡¡¡Ö»¶Á´ò¿ªÒ»¸öÎı¾Îļþ£¬Ö»ÔÊÐí¶ÁÊý¾Ý
“wt”¡¡¡¡¡¡¡¡    ֻд ......

[תÔØ]C/C++ÓïÑÔÎóÇøÒ» —— void main( )

 ÔÚÍøÉÏ¿´µ½ÁËÕâƪÎÄÕ£¬·Ç³£²»´í£¬»ñÒæ·Ëdz£¬ÓÚÊÇת¹ýÀ´£¬Ï£ÍûÄܶԴó¼ÒÓÐËùñÔÒæ¡£ÎÄÕÂÔ­×÷Õߣºantigloss http://free3.e-168.cn/antigloss/
     ºÜ¶àÈËÉõÖÁÊÐÃæÉϵÄһЩÊé¼®£¬¶¼Ê¹ÓÃÁËvoid main( ) £¬ÆäʵÕâÊÇ´íÎóµÄ¡£C/C++ ÖдÓÀ´Ã»Óж¨Òå¹ývoid main( ) ¡£C++ Ö®¸¸ Bjarne Stroustrup ÔÚËûµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ