c/c++ÖеÄλ²Ù×÷
C\C++Ö§³Ö±È½ÏµÍ½×µÄλÔËË㣬ÔÚÊÇÖÚÈ˽ÔÖªµÄÁË¡£Ã¿±¾C\C++µÄ½Ì¿ÆÊ鶼»á˵µ½Õⲿ·ÖµÄÄÚÈÝ£¬²»¹ý¶¼ºÜ¼òÂÔ£¬ÎÒÏë»áÓкܶàÈ˲»ÖªµÀλÔËËãÓÃÔÚʲôµØ·½¡£Õâ¸öÌû×ӾͼòÂÔ˵˵λÔËËãµÄÓô¦£¬¸ü½øÒ»²½µÄÓ÷¨Òª´ó¼Ò×Ô¼ºÈ¥Ìå»á¡£¶øÖ÷Ҫ˵µÄÊDzÙ×÷±êÖ¾Öµ·½Ãæ¡£
/****************************************/
#define BTI_MSK(bit) (1 << (bit))
#define BIT_SET(x,bit) ((x) |= BTI_MSK (bit))
#define BIT_CLR(x,bit) ((x) &= ~BTI_MSK (bit))
#define BIT_TST(x,bit) ((x) & BTI_MSK (bit))
/****************************************/
¿¼ÂÇÒ»¸öÊÂÎï¡¢Ò»¸öϵͳ¡¢»òÕßÒ»¸ö³ÌÐò¿ÉÄÜ»á³öÏÖÒ»ÖÖ»òÕß¼¸ÖÖ״̬¡£ÎªÁËÔÚ²»Í¬µÄ״̬Ï£¬×÷³ö²»Í¬µÄÐÐΪ£¬Äã¿ÉÒÔÉèÁ¢Ò»Ð©±êÖ¾Öµ£¬ÔÙ¸ù¾Ý±êÖ¾ÖµÀ´×öÅжϡ£±ÈÈçC++µÄÎļþÁ÷£¬Äã¾Í¿ÉÒÔÉ趨һЩ±êÖ¾Öµ£¬ios::app, ios::ate, ios::binary, ios::in, ios::out, ios::trunc£¬²¢ÇÒ¿ÉÒÔ½«ËüÓÃ|×éºÏÆðÀ´´´½¨Ò»¸öÇ¡µ±µÄÎļþÁ÷¡£Äã¿ÉÄܻὫÕâЩ±êÖ¾Öµ¶¨ÒåΪboolÀàÐÍ£¬²»¹ýÕâÑùÒªÊÇÉèÖõıêÖ¾ÖµÒ»¶à£¬¾Í»áºÜÀ˷ѿռ䡣
¶ø¼ÙÈ綨ÒåÒ»¸öÕûÐÍÊýÖµ£¬unsigned int flags; ÔÚÏÖÔÚµÄϵͳ£¬flagsÓ¦¸ÃÊÇ32λ, ÓÃ1,2,3....32½«Î»½øÐбàºÅ£¬ÎÒÃÇ¿ÉÒÔ½øÐÐÕâÑùµÄÅжÏ, µ±Î»1È¡1ʱ£¬±íʾÓöÁ·½Ê½´ò¿ªÎļþ£¬µ±Î»2È¡1ʱ£¬±íʾÓÃд·½Ê½´ò¿ªÎļþ£¬µ±Î»3È¡1ʱ£¬Óöþ½øÖÆ·½Ê½´ò¿ªÎļþ....ÒòΪflagsÓÐ32룬¾Í¿ÉÒÔÉèÖÃ32¸ö²»Í¬µÄ״ֵ̬£¬Ò²Ï൱ÓÚ32¸öboolÀàÐÍ¡£ÕâÑùÒ»·½ÃæÊ¡ÁË¿Õ¼ä, ÁíÒ»·½ÃæÒ²¶àÁ˸öºÃ´¦£¬¾ÍÊÇÈçÇ°ÃæËù˵µÄ£¬¿ÉÒÔ½«±êÖ¾Öµ×éºÏÆðÀ´¡£
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ºÃÀ²£¬ÉÏÃæÓе㲻Çå²»³þµÄ¡£ÏÂÃæ¿´¿´µ½µ×Ôõô²Ù×÷ÕâЩ±êÖ¾Öµ¡£
ÉèÏëC++µÄÀàiosÕâÑù¶¨Òå, ÆäʵûÓÐÕâ¸öÀֻ࣬ÓÐios_basicÀ࣬typedef basic_ios<char> ios;
class ios
{
public:
enum { app = 0x0001, ate = 0x000
Ïà¹ØÎĵµ£º
Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸еģ¬»î»î»î£¡
&n ......
#
ÊÇÉú³É×Ö·û´®£º
#define a(x) #x
a(bc
) => "bc"
##
ÊÇÁ¬½Ó£º
#define a(x) abc##x
&n ......
Ç°ÃæÁ½Æª»ù±¾°ÑÖ¸Õë¸ø½éÉÜÍêÁË£¬ÏàÐÅ´ó¼Ò¶ÔÖ¸ÕëÒѾ²»ÊÇÄÇôİÉúÁË¡£Ò²²»»áÒòΪָÕëºÍÊý×éÖ®¼äµÄ¹Øϵ¶øµ¼Ö»ìÏýÁË¡£´ó¼Ò¿ÉÄÜÒ²ÆȲ»¼°´ýÏëÁ˽âϺóÀ´µÄ֪ʶ¡£½ñÌìÎÒÃǾͽéÉÜϽṹÌå¡£
¶ÔÓڽṹÌ壬¼ÈÈ»½Ð½á¹¹Ì壬ÐÎÏóÉÏÎÒÃÇ¿ÉÒÔÀí½âÆä¾ÍÊÇÒ»¶ÑÊý¾Ý¼¯ºÏÔÚÒ»ÆðÐγÉÒ»¸ö½á¹¹¡£¾Í±ÈÈçÒ»¸öѧÉúµÄÐÅÏ¢°üÀ¨£ºÑ§ºÅ¡¢ÐÕÃû¡¢°à¼¶¡¢Äê ......
Gcc¼ò½é
LinuxϵͳϵÄgcc£¨GNU C Compiler£©ÊÇGNUÍƳöµÄ¹¦ÄÜÇ¿´ó¡¢ÐÔÄÜÓÅÔ½µÄ¶àƽ̨±àÒëÆ÷£¬ÊÇGNUµÄ´ú±í×÷Æ·Ö®Ò»¡£gccÊÇ¿ÉÒÔÔÚ¶àÖÖÓ²Ìåƽ̨ÉϱàÒë³ö¿ÉÖ´ÐгÌÐòµÄ³¬¼¶±àÒëÆ÷£¬ÆäÖ´ÐÐЧÂÊÓëÒ»°ãµÄ±àÒëÆ÷Ïà±Èƽ¾ùЧÂÊÒª¸ß20%~30%¡£
gcc ±àÒëÆ÷Äܽ«C¡¢C++ÓïÑÔÔ´³ÌÐò¡¢»ã³Ìʽ»¯ÐòºÍÄ¿±ê³ÌÐò±àÒë¡¢Á¬½Ó³É¿ÉÖ´ÐÐÎļþ£¬Èç¹ûûÓи ......
1. ²ÉÓö̱äÁ¿¡£ÈçbData£¬unsigned char¡£
2. ÎÞ·ûºÅ±äÁ¿¡£51²»Ö§³Ö·ûºÅÔËËã¡£
3. ±ÜÃâʹÓø¡µãÖ¸Õë¡£¸¡µãÔËËãʱҪ½ûÖ¹Öжϡ£
4. &nb ......