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

ÈçºÎÀí½âcºÍc++ µÄ¸´ÔÓÀàÐÍÉùÃ÷

int main(int argc, char* argv[])
    {
    /**//* ************************************************************
            Ö¸Õë
    **************************************************************/
        int *i = new int(4);
        int j = 2;
        int rgNum[30][4];
        int (*p)[4] = rgNum;//p±»ÉùÃ÷Ϊһ¸öÖ¸ÏòÒ»¸ö4ÔªËØ£¨intÀàÐÍ£©Êý×éµÄÖ¸Õë

        int *q[5];//q±»ÉùÃ÷Ϊһ¸ö°üº¬5¸öÔªËØ£¨intÀàÐ͵ÄÖ¸Õ룩µÄÊý×é

        int **p1;//p1ÊÇÒ»¸öintÀàÐ͵ÄÖ¸ÕëµÄÖ¸Õë
        int *&p2 = i ;//p2ÊÇÒ»¸öintÀàÐ͵ÄÖ¸ÕëµÄÒýÓÃ
    //     int &*p3;//ERROR: Pointer  to a reference is illegal.
    //     int &&p4;//ERROR: Reference to a reference is illegal.

    /**//**************************************************************
            const
    ***************************************************************/
        const int n = 5;//const¹Ø¼ü×Ö·ÅÔÚÀàÐÍ»ò±äÁ¿Ãû֮ǰµÈ¼ÛµÄ
        int const m = 10;//const¹Ø¼ü×Ö·ÅÔÚÀàÐÍ»ò±äÁ¿Ãû֮ǰµÈ¼ÛµÄ

        int * const r = i;//Ö¸ÕërµÄÖµ½«²»ÔÙÔÊÐí±»¸Ä±ä,µ«*rµÄÖµ¿ÉÒԸıä.
        *r = 2;

        const int *l= &n;//*lµÄÖµ²»Äܸı䣬µ«l¿ÉÒԸıä
        l= &j;

    /**//**************************************************************
   &nbs


Ïà¹ØÎĵµ£º

һƪ·Ç³£ºÃµÄ½éÉÜc¡¢c++ÖÐÓйØʱ¼äº¯ÊýµÄÓ÷¨


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

´Óprintf()̸c/c++Öпɱä²ÎÊýº¯ÊýµÄʵÏÖ


´Óprintf̸¿É±ä²ÎÊýº¯ÊýµÄʵÏÖ ×ªÌù
Ô­ÎÄ×÷ÕߣºÈÖÑÇÐÂ
ÕªÒª£ºÒ»Ö±ÒÔÀ´¶¼¾õµÃprintfËƺõÊÇcÓïÑÔ¿âÖй¦ÄÜ×îÇ¿´óµÄº¯ÊýÖ®Ò»£¬²»½öÒòΪËüÄܸñʽ»¯Êä³ö£¬¸üÔÚÓÚËüµÄ²ÎÊý¸öÊýûÓÐÏÞÖÆ£¬Òª¼¸¸ö¾Í¸ø¼¸¸ö£¬À´Õß²»¾Ü¡£printfÕâÖÖ¶Ô²ÎÊý¸öÊýºÍ²ÎÊýÀàÐ͵ÄÇ¿´óÊÊÓ¦ÐÔ£¬ÈÃÈ˲úÉúÁ˶ÔËü½øÐÐ̽Ë÷µÄŨºñÐËȤ¡£
¹Ø¼ü×Ö£ºprintf, ¿É±ä²ÎÊ ......

CºÍC++µÄѧϰÀú³Ì

Ò»¼ÒÖ®ÑÔ£¬»¶Ó­ÅÄש¹þ¡£

1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC.

 ´ó¶àÊýʱºò£¬ÎÒÃÇѧϰÓïÑÔµÄÄ¿µÄ£¬²»ÊÇΪÁ˳ÉΪһ¸öÓïÑÔר¼Ò£¬¶øÊÇÏ£Íû³ÉΪһ¸ö½â¾öÎÊÌâµÄר¼Ò¡£×öÒ»¸öÓÐÓõijÌÐòÔ±£¬×öÒ»¸ö׬ǮµÄ³ÌÐòÔ±¡£ÎÒÃǵļÛÖµ£¬½«ÌåÏÖÔÚ¿Í»§¼ÛÖµÉÏ£¬¶ø²»ÊÇÓïÑÔдµÃºÃ²»ºÃ¿´¡£


C++ÊÇCµÄÒ»¸öÃæÏò¶ÔÏóµÄ½âÊÍ£¬C++ΪCÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ