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

C/C++ÖйØÓÚ±éÀúÎļþ¼ÐµÄ²Ù×÷

#include <windows.h>
#include <stdio.h>
void FindFileInDir(char* rootDir, char* strRet)
{
char fname[256];
ZeroMemory(fname,256);
WIN32_FIND_DATA fd;
ZeroMemory(&fd, sizeof(WIN32_FIND_DATA));
HANDLE hSearch;
char filePathName[256];
char tmpPath[256];
ZeroMemory(filePathName, 256);
ZeroMemory(tmpPath, 256);
strcpy(filePathName, rootDir);
BOOL bSearchFinished = FALSE;
if( filePathName[strlen(filePathName) -1] != '\\' )
{
strcat(filePathName, "\\");
}
strcat(filePathName, "*");
hSearch = FindFirstFile(filePathName, &fd);
//Is directory
if( (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
&& strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, "..") )
{
strcpy(tmpPath, rootDir);
strcat(tmpPath, fd.cFileName);
FindFileInDir(tmpPath, strRet);
}
else if( strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, "..") )
{
sprintf(fname, "%-50.50s", fd.cFileName);
strcat(strRet + strRet[strlen(strRet)] , fname);
}
while( !bSearchFinished )
{
if( FindNextFile(hSearch, &fd) )
{
if( (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
&& strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, "..") )
{
strcpy(tmpPath, rootDir);
strcat(tmpPath, fd.cFileName);
FindFileInDir(tmpPath, strRet);
}
else if( strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, "..") )
{
sprintf(fname, "%-50.50s", fd.cFileName);
strcat(strRet + strRet[strlen(strRet)] , fname);
}
}
else
{
if( GetLastError() == ERROR_NO_MORE_FILES ) //Normal Finished
{
bSearchFinished = TRUE;
}
else
bSearchFinished = TRUE; //Terminate Search
}
}
FindClose(hSearch);
}
main()
{
}

°ÑÕâ¶Î´úÂ븴ÖÆ¡¡Áí´æΪºó׺Ϊ¡¡£®£Ã£Ð£Ð¡¡Îļþ¡¡È»ºó±àÒë¡¡¿ÉÒÔ±àÒë
ÔÚÀ´¿´¿´ÄãµÄÄǸö
»¨Á˼¸·ÖÖӸijÉÁË¡¡£ÃÓïÑÔ
Ìù³öÀ´ÁË
Äã°ÑϱߵĴúÂ븴ÖÆ
Áí´æΪºó׺Ϊ¡¡.£Ã¡¡µÄÎļþ
È»ºó¡¡±àÒë¡¡¾Í¿ÉÒÔÁË
#include <windows.h>
#include <stdio.h>
void FindFileInDir(char* rootDir, char* strRet)
{
char fname[256];
WIN32_FIN


Ïà¹ØÎĵµ£º

C ÓïÑÔÈëÃÅÖ¸µ¼

C ÓïÑÔ
  
CÓïÑÔÊÇÒ»ÖÖ¼ÆËã»úÓïÑÔ£¬¼òµ¥µÄ½²ËüÊÇÎÒÃǺͼÆËã»ú¹µÍ¨µÄÒ»ÖÖ¹¤¾ß£¬Í¨¹ýÕâÖÖÓïÑÔÎÒÃÇ¿ÉÒÔÒýµ¼¼ÆËã»úÈÃËü°´ÕÕÎÒÃǵÄÒâԸȥ×öÊ£¬À´ÎªÈËÀàÌṩ·þÎñ¡£±ÈÈçÄãµçÄÔÖеÄÒôÀÖ²¥·ÅÆ÷¡¢word¡¢qq¡¢Ñ¸À×£¨µ±È»ÕâЩÈí¼þµÄ±àд»¹Ó¦ÓÃÁËÇÒËû¹¤¾ß£©¡£
CÓïÑÔ¿ÉÒÔ×÷Ϊ¹¤×÷ϵͳÉè¼ÆÓïÑÔ£¬±àдϵͳӦÓóÌÐò£¬Ò²¿ÉÒÔ×÷Î ......

c/c++ÓïÑÔÎÊÌâÖпɱä²ÎÊý


 va_listÊÇc/c++ÓïÑÔÎÊÌâÖнâ¾ö¿É±ä²ÎÊýµÄÒ»×éºê.ÏÈÀ´¿´Ò»¸ö³ÌÐòÀý×Ó°É.
view plaincopy to clipboardprint?
#include <stdarg.h>   
/**¡¡º¯ÊýÃû£ºmax  
  *¡¡¹¦ÄÜ£º·µ»Øn¸öÕûÊýÖеÄ×î´óÖµ  
  *  ²ÎÊý£ºnum£ºÕûÊýµÄ¸öÊý . ......

¶ÔC/C++¿É±ä²ÎÊý±íµÄÉî²ã̽Ë÷


ÒýÑÔ
¡¡¡¡C/C++ÓïÑÔÓÐÒ»¸ö²»Í¬ÓÚÆäËüÓïÑÔµÄÌØÐÔ£¬¼´ÆäÖ§³Ö¿É±ä²ÎÊý£¬µäÐ͵ĺ¯ÊýÈçprintf¡¢scanfµÈ¿ÉÒÔ½ÓÊÜÊýÁ¿²»¶¨µÄ²ÎÊý¡£È磺
printf ( "I love you" ); 
printf ( "%d", a );
printf ( "%d,%d", a, b );
¡¡¡¡µÚÒ»¡¢¶þ¡¢Èý¸öprintf·Ö±ð½ÓÊÜ1¡¢2¡¢3¸ö²ÎÊý£¬ÈÃÎÒÃÇ¿´¿´printfº¯ÊýµÄÔ­ÐÍ£º
int printf ( const ......

scanf("%c")

½ñÌì×öÁËACM1010
´úÂ붼¶Ô¾ÍÊÇÔõôҲ²»ÄÜAC¡£ÄǸöÓôÃÆ°¡£¡Ò»ÍíÉ϶¼ÏëÄǸöÁË¡£
±¾À´ÓÐÁ©×éÊäÈ룬¿ÉÊÇÊä³öµÄ½á¹û¾ÍÒ»×é¡£×Ðϸ¿´ÊäÈ룬¾¹È»×Ô¶¯»»ÐÐÁË£¬Ææ¹Ö£¬ÕâÊÇÕ¦»ØÊ¡£
²Â²â¿ÉÄÜÊǶÁÈëÁË»»Ðзû¡£Í¬ÑùµÄÎÊÌâÕâC++ÖоÍûÓа¡!
×îºóͨ¹ý¼Ógetchar();ACͨ¹ý¡£ ......

C multi line macro: do/while(0) vs scope block

http://docs.google.com/View?docid=ajbgz6fp3pjh_2dwwwwt#_38239340844832237
It is not about optimization.
The whole idea of using 'do/while' version
is to make a macro which will
expand into a regular statement, not into a
compound statement. This is
done in order to make the use of function-s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ