CÃæÊÔÌâ
1 ££i nclude “filename.h”ºÍ££i nclude <filename.h>µÄÇø±ð?
´ð£º¶ÔÓÚ££i nclude <filename.h>±àÒëÆ÷´Ó±ê×¼¿â¿ªÊ¼ËÑË÷filename.h
¶ÔÓÚ££i nclude “filename.h”±àÒëÆ÷´ÓÓû§¹¤×÷·¾¶¿ªÊ¼ËÑË÷filename.h
2 Í·ÎļþµÄ×÷ÓÃÊÇʲô?
´ð£ºÒ»¡¢Í¨¹ýÍ·ÎļþÀ´µ÷Óÿ⹦ÄÜ¡£ÔںܶೡºÏ£¬Ô´´úÂë²»±ã£¨»ò²»×¼£©ÏòÓû§¹«²¼£¬Ö»ÒªÏòÓû§ÌṩͷÎļþºÍ¶þ½øÖƵĿ⼴¿É¡£Óû§Ö»Ðè
Òª°´ÕÕÍ·ÎļþÖеĽӿÚÉùÃ÷À´µ÷Óÿ⹦ÄÜ£¬¶ø²»±Ø¹ØÐĽӿÚÔõôʵÏֵġ£±àÒëÆ÷»á´Ó¿âÖÐÌáÈ¡ÏàÓ¦µÄ´úÂë¡£
¶þ¡¢Í·ÎļþÄܼÓÇ¿ÀàÐÍ°²È«¼ì²é¡£Èç¹ûij¸ö½Ó¿Ú±»ÊµÏÖ»ò±»Ê¹ÓÃʱ£¬Æ䷽ʽÓëÍ·ÎļþÖеÄÉùÃ÷²»Ò»Ö£¬±àÒëÆ÷¾Í»áÖ¸³ö´íÎó£¬ÕâÒ»¼òµ¥µÄ¹æ
ÔòÄÜ´ó´ó¼õÇá³ÌÐòÔ±µ÷ÊÔ¡¢¸Ä´íµÄ¸ºµ£¡£
3 C++º¯ÊýÖÐÖµµÄ´«µÝ·½Ê½ÓÐÄļ¸ÖÖ?
´ð£ºC++º¯ÊýµÄÈýÖÖ´«µÝ·½Ê½Îª£ºÖµ´«µÝ¡¢Ö¸Õë´«µÝºÍÒýÓô«µÝ¡£
4 ÄÚ´æµÄ·ÖÅ䷽ʽµÄ·ÖÅ䷽ʽÓм¸ÖÖ?
´ð£ºÒ»¡¢´Ó¾²Ì¬´æ´¢ÇøÓò·ÖÅä¡£ÄÚ´æÔÚ³ÌÐò±àÒëµÄʱºò¾ÍÒѾ·ÖÅäºÃ£¬Õâ¿éÄÚ´æÔÚ³ÌÐòµÄÕû¸öÔËÐÐÆڼ䶼´æÔÚ¡£ÀýÈçÈ«¾Ö±äÁ¿¡£
¶þ¡¢ÔÚÕ»ÉÏ´´½¨¡£ÔÚÖ´Ðк¯Êýʱ£¬º¯ÊýÄÚ¾Ö²¿±äÁ¿µÄ´æ´¢µ¥Ôª¶¼¿ÉÒÔÔÚÕ»ÉÏ´´½¨£¬º¯ÊýÖ´ÐнáÊøʱÕâЩ´æ´¢µ¥Ôª×Ô¶¯±»ÊÍ·Å¡£Õ»ÄÚ
´æ·ÖÅäÔË
ËãÄÚÖÃÓÚ´¦ÀíÆ÷µÄÖ¸ÁÖУ¬Ð§Âʺܸߣ¬µ«ÊÇ·ÖÅäµÄÄÚ´æÈÝÁ¿ÓÐÏÞ¡£
Èý¡¢´Ó¶ÑÉÏ·ÖÅ䣬Òà³Æ¶¯Ì¬ÄÚ´æ·ÖÅä¡£³ÌÐòÔÚÔËÐеÄʱºòÓÃmalloc»ònewÉêÇëÈÎÒâ¶àÉÙµÄÄڴ棬³ÌÐòÔ±×Ô¼º¸ºÔðÔÚºÎʱÓÃfree
»òdeleteÊÍ·Å
ÄÚ´æ¡£¶¯Ì¬ÄÚ´æµÄÉú´æÆÚÓÉÎÒÃǾö¶¨£¬Ê¹Ó÷dz£Áé»î£¬µ«ÎÊÌâÒ²×î¶à¡£
5 ʵÏÖË«ÏòÁ´±íɾ³ýÒ»¸ö½ÚµãP£¬ÔÚ½ÚµãPºó²åÈëÒ»¸ö½Úµã£¬Ð´³öÕâÁ½¸öº¯Êý;
´ð£ºË«ÏòÁ´±íɾ³ýÒ»¸ö½ÚµãP
template<class type> void list<type>::delnode(int p)
{
int k=1;
listnode<type> *ptr,*t;
ptr=first;
while(ptr->next!=NULL&&k!=p)
{
ptr=ptr->next;
k++;
}
t=ptr->next;
cout<<"ÄãÒѾ½«Êý¾ÝÏî "<<t->data<<"ɾ³ý"<<endl;
ptr->next=ptr->next->next;
length--;
delete t;
}
ÔÚ½ÚµãPºó²åÈëÒ»¸ö½Úµã£º
template<class type> bool list<type>::insert(type t,int p)
{
listnode<ty
Ïà¹ØÎĵµ£º
ÕâƪÎÄÕÂÖмǼ±¾È˶ÔһЩC/C++»ù´¡¸ÅÄîµÄÀí½â£¬Ö÷Òª°üÀ¨ÒÔϼ¸¸ö·½ÃæÄÚÈÝ£º
1¡¢ÀàÐÍת»»
1¡¢ÀàÐÍת»»
ÔÚCºÍC++µÄÒ»¸ö±í´ïʽÖÐÍùÍù»á°üº¬¼¸ÖÖ²»Í¬µÄÊý¾ÝÀàÐÍ£¬ÒªÈÃÕâЩÊý¾ÝÀàÐÍÖ®¼ä¿ÉÒÔ½øÐÐÔËË㣬±ØÐëÈÃËûÃÇÖ®ÖеÄһЩ»òÈ«²¿½øÐÐÀàÐÍת»»£¬ÕâÖÖת»»ÓÐÁ½ÖÖÐÎʽ£¬Ò»ÖÖÊDZàÒëÆ÷×Ô¶¯½øÐеģ¬½ÐÒþʽÀàÐÍת»»£¬ÁíÒ»ÖÖÊDZà³ÌÖÐÇ ......
µÚ2ÕÂ
»·¾³£º·Òë»·¾³: Ô´´úÂëת»¯³É¿ÉÖ´ÐеĻúÆ÷Ö¸Áî¡£
Ö´Ðл·¾³£ºÓÃÓÚʵ¼ÊÖ´ÐдúÂë¡£
·Ò룺ԴÎļþ-¡µÄ¿±êÎļþ-¡µ¿ÉÖ´ÐÐÎļþ£¨Í¨¹ýÁ´½ÓÆ÷½«¶à¸öÄ¿±êÎļþÀ¦°óÔÚÒ»Æð£©
±àÒë¹ý³Ì£ºÔ¤´¦ÀíÆ÷-¡µÔ´´úÂë¾¹ý½âÎö²úÉúÄ¿±ê´úÂ루Õâ¸ö¹ý³ÌÖÐÊǾø´ó¶àÊý´íÎóºÍ¾¯¸æ²úÉúµÄµØ·½£©-¡µÓÅ»¯Æ÷£¨¾ÍÊǶÔÄ¿±ê´úÂë½øÐнøÒ»²½ÓÅ»¯£¬Ê¹Ð§ÂÊ ......
#include <list.h>
#include <dirent.h>
#include <iostream.h>
#include <sys/stat.h>
#include <sys/types.h>
/*****************************************************************
*º¯Êý¹¦ÄÜ: Ä¿_¼_±é_Àú.
*·µ»ØÖµ: ³É¹¦·µ»Ø0,ʧ°Ü·µ»Ø·Ç0.
*²ÎÊý path ......
http://blog.csdn.net/hwz119/archive/2007/05/25/1625218.aspx
ÄúÊÇ·ñ×ö¹ýÕâÑùÒ»¸öÏîÄ¿£¬ËüÒªÇóÄúÔÚÄÚ´æÖб£´æÊýÄ¿²»¶¨µÄÈô¸É²»Í¬¶ÔÏ󣿶ÔÓÚijЩÇé¿ö£¬¶þ²æÊ÷ÊÇ×î¼ÑÑ¡Ôñ£¬µ«ÔÚͨ³£Çé¿öÏ£¬¸ü¼òµ¥µÄÁ´±íÊÇÏÔ¶øÒ×¼ûµÄÑ¡Ôñ¡£
Ò»¸ö¼ò»¯µÄÎÊÌâʾÀý
Á´±íµÄÄѵãÔÚÓÚ±ØÐ븴ÖÆÁ´±í´¦Àíº¯ÊýÀ´´¦Àí²»Í¬µÄ¶ÔÏó ......