ÔÚ C/C++ÖÐÈçºÎ¹¹ÔìͨÓõĶÔÏóÁ´±í(²»ºÜÀí½â )
http://blog.csdn.net/hwz119/archive/2007/05/25/1625218.aspx
ÄúÊÇ·ñ×ö¹ýÕâÑùÒ»¸öÏîÄ¿£¬ËüÒªÇóÄúÔÚÄÚ´æÖб£´æÊýÄ¿²»¶¨µÄÈô¸É²»Í¬¶ÔÏ󣿶ÔÓÚijЩÇé¿ö£¬¶þ²æÊ÷ÊÇ×î¼ÑÑ¡Ôñ£¬µ«ÔÚͨ³£Çé¿öÏ£¬¸ü¼òµ¥µÄÁ´±íÊÇÏÔ¶øÒ×¼ûµÄÑ¡Ôñ¡£
Ò»¸ö¼ò»¯µÄÎÊÌâʾÀý
Á´±íµÄÄѵãÔÚÓÚ±ØÐ븴ÖÆÁ´±í´¦Àíº¯ÊýÀ´´¦Àí²»Í¬µÄ¶ÔÏ󣬼´±ãÂß¼ÊÇÍêÈ«ÏàͬµÄ¡£ÀýÈ磺
Á½¸ö½á¹¹ÀàËƵÄÁ´±í
struct Struct_Object_A
{
int a;
int b;
Struct_Object_A *next;
} OBJECT_A;
typedef struct Struct_Object_B
{
int a;
int b;
int c;
Struct_Object_B *next;
} OBJECT_B;
ÉÏÃ涨ÒåµÄÁ½¸ö½á¹¹Ö»ÓкÜСµÄÒ»µã²î±ð¡£OBJECT_B ºÍ OBJECT_A Ö®¼äÖ»²îÒ»¸öÕûÐͱäÁ¿¡£µ«ÊÇ£¬ÔÚ±àÒëÆ÷¿´À´£¬ËüÃÇÈÔÈ»ÊǷdz£²»Í¬µÄ¡£±ØÐëΪ´æ´¢ÔÚÁ´±íÖеÄÿ¸ö¶ÔÏó¸´ÖÆÓÃÀ´Ìí¼Ó¡¢É¾³ýºÍËÑË÷Á´±íµÄº¯Êý¡£ÎªÁ˽â¾öÕâ¸öÎÊÌ⣬¿ÉÒÔʹÓþßÓÐÈ«²¿Èý¸ö±äÁ¿µÄÒ»¸öÁªºÏ»ò½á¹¹£¬ÆäÖÐÕûÊý c ²¢²»ÊÇÔÚËùÓеÄÇé¿ö϶¼ÒªÊ¹Óá£Õâ¿ÉÄܱäµÃ·Ç³£¸´ÔÓ£¬²¢»áÐγɲ»Á¼µÄ±à³Ì·ç¸ñ¡£
C ´úÂë½â¾ö·½°¸£ºÐéÄâÁ´±í
´ËÎÊÌâ¸üºÃµÄ½â¾ö·½°¸Ö®Ò»ÊÇÐéÄâÁ´±í¡£ÐéÄâÁ´±íÊÇÖ»°üº¬Á´±íÖ¸ÕëµÄÁ´±í¡£¶ÔÏó´æ´¢ÔÚÁ´±í½á¹¹±³ºó¡£ÕâÒ»µãÊÇÕâÑùʵÏֵģ¬Ê×ÏÈΪÁ´±í½Úµã·ÖÅäÄڴ棬½Ó×ÅΪ¶ÔÏó·ÖÅäÄڴ棬Ȼºó½«Õâ¿éÄÚ´æ·ÖÅä¸øÁ´±í½ÚµãÖ¸Õ룬ÈçÏÂËùʾ£º
ÐéÄâÁ´±í½á¹¹µÄÒ»ÖÖʵÏÖ
typedef struct liststruct
{
liststruct *next;
} LIST, *pLIST;
pLIST Head = NULL;
pLIST AddToList( pLIST Head, void * data, size_t datasize )
{
pLIST newlist=NULL;
void *p;
// ·ÖÅä½ÚµãÄÚ´æºÍÊý¾ÝÄÚ´æ
newlist = (pLIST) malloc( datasize + sizeof( LIST ) );
// ΪÕâ¿éÊý¾Ý»º³åÇøÖ¸¶¨Ò»¸öÖ¸Õë
p = (void *)( newlist + 1 ); //²»Àí½â
// ¸´ÖÆÊý¾Ý
memcpy( p, data, datasize );
// ½«Õâ¸ö½ÚµãÖ¸¶¨¸øÁ´±íµÄ±íÍ·
if( Head!=NULL )
{
newlist
Ïà¹ØÎĵµ£º
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸еģ¬»î»î»î£¡
&n ......
C/C++ÄÚ´æÓëÔËÐÐʱÉîÈëÑо¿ [×÷ÕßJean.Love]
-----------------------------------------------------------------------------------
(Ò»)ÕûÊý·ûºÅµÄÏÝÚå
(¶þ)¸¡µãÊýµÄ±¾ÖÊ
(Èý)¶ÑÕ»µÄÄÚ´æ¹ÜÀí½á¹¹
(ËÄ)·ûºÅ½âÎö
(Îå)¶ÔÆëºÍ×ÜÏß´íÎó
(Áù)º¯ÊýÖ¸Õë
(Æß)Ð麯ÊýµÄÊ ......
ÕâƪÎÄÕÂÖмǼ±¾È˶ÔһЩC/C++»ù´¡¸ÅÄîµÄÀí½â£¬Ö÷Òª°üÀ¨ÒÔϼ¸¸ö·½ÃæÄÚÈÝ£º
1¡¢ÀàÐÍת»»
1¡¢ÀàÐÍת»»
ÔÚCºÍC++µÄÒ»¸ö±í´ïʽÖÐÍùÍù»á°üº¬¼¸ÖÖ²»Í¬µÄÊý¾ÝÀàÐÍ£¬ÒªÈÃÕâЩÊý¾ÝÀàÐÍÖ®¼ä¿ÉÒÔ½øÐÐÔËË㣬±ØÐëÈÃËûÃÇÖ®ÖеÄһЩ»òÈ«²¿½øÐÐÀàÐÍת»»£¬ÕâÖÖת»»ÓÐÁ½ÖÖÐÎʽ£¬Ò»ÖÖÊDZàÒëÆ÷×Ô¶¯½øÐеģ¬½ÐÒþʽÀàÐÍת»»£¬ÁíÒ»ÖÖÊDZà³ÌÖÐÇ ......
×Ö·ûÊý×éºÍ×Ö·û´®
&×Ö·ûÊý×éºÍ×Ö·û´®µÄ¸ÅÄî &×Ö·ûÊý×éµÄ³õʼ»¯
&×Ö·û´®µÄÊäÈëÊä³ö &×ۺϾÙÀý
×Ö·ûÊý×éºÍ×Ö·û´®µÄ¸ÅÄî
×Ö·ûÊý×éÊÇÔªËØÀàÐÍΪ×Ö·ûµÄÊý×é ,Ëü¼È¾ßÓÐÆÕͨÊý×éµÄÒ»°ãÐÔÖÊ ,ÓÖ¾ßÓÐijЩÌØÊâÐÔÖÊ¡£
& ......
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
/****************************************************
* º¯Êý¹¦ÄÜ: ÅжϲÎÊý·¾¶ÊÇ·ñΪ(ÕýÈ·µÄ)Ŀ¼
* º¯Êý·µ»Ø: 0Ϊ±íʾ·¾¶ÎªÎļþ,1Ϊ·ÇĿ¼.ÆäËûΪ´íÎó
* ²ÎÊý: pathÎļþÐèÒªÅжϵÄĿ¼µÄ·¾¶.
*  ......