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

c/c++_static±äÁ¿µÄÓ¦ÓÃ

ÔÚCÓïÑÔ±à³ÌÖУ¬staticµÄÒ»¸ö×÷ÓÃÊÇÐÅÏ¢ÆÁ±Î£¡
±È·½Ëµ£¬Äã×Ô¼º¶¨ÒåÁËÒ»¸öÎļþ -- ¸ÃÎļþÖÐÓÐһϵÁеĺ¯ÊýÒÔ¼°±äÁ¿µÄÉùÃ÷ºÍ¶¨Ò壡
ÄãÏ£Íû¸ÃÎļþÖеÄһЩº¯ÊýºÍ±äÁ¿Ö»Äܱ»¸ÃÎļþÖеĺ¯ÊýʹÓã¬ÄÇô£¬Äã¿ÉÒÔÔڸú¯Êý¡¢±äÁ¿µÄÇ°Ãæ¼ÓÉÏstatic£¬´ú±íËûÃÇÖ»Äܱ»µ±Ç°ÎļþÖеĺ¯ÊýʹÓã¡
¶øÔÚC++ÖУ¬ÓÃstaticÀ´×÷ΪÐÅÏ¢ÆÁ±Î¾ÍÏÔµÃûÓбØÒªÁË£¡ÒòΪ£¬C++ÓÐÁËÐÅÏ¢ÆÁ±ÎµÄÀûÆ÷ -- class»úÖÆ£¡
ÀàÖеÄprivateÊôÐԵıäÁ¿ºÍº¯Êý¾Í¶ÔÍâ½ûÖ¹·ÃÎÊ£¡
È»ºóÊÇC/C++ͨÓõĺ¯Êý×÷ÓÃÓòµÄstaticÐ͵ıäÁ¿£¡ÆäÄ¿µÄ£¬Ò²ÊÇΪÁËÐÅÏ¢µÄÆÁ±Î£¡
int fun() {
   static int a = 1;
   a++;
}
ÔÚµÚÒ»´Î½øÈëÕâ¸öº¯ÊýµÄʱºò£¬±äÁ¿a±»³õʼ»¯Îª1£¡²¢½Ó×Å×ÔÔö1£¡
ÒÔºóÿ´Î½øÈë¸Ãº¯Êý£¬a¾Í²»»á±»Ôٴγõʼ»¯ÁË£¬½ö½øÐÐ×ÔÔö1µÄ²Ù×÷£¡
ÔÚstatic·¢Ã÷Ç°£¬Òª´ïµ½Í¬ÑùµÄ¹¦ÄÜ£¬ÔòÖ»ÄÜʹÓÃÈ«¾Ö±äÁ¿£º
int a = 1;
int fun() {
   a++;
}
ÄÇô£¬aµÄÖµ¾ÍÓпÉÄܱ»ÆäËûº¯ÊýËù¸Ä±ä£¡
×îºó£¬ËµËµÀàÖеÄstatic±äÁ¿ºÍº¯Êý¡£
ÕâÖÖ´æ´¢ÊôÐԵıäÁ¿ºÍº¯ÊýÊÇͬһÖÖÀàµÄ²»Í¬ÊµÀýÖ®¼äͨÐŵÄÇÅÁº£¡
#include <iostream>
using namespace std;
class A {
public:
    static int num;    //    Í³¼Æ´´½¨Á˶àÉÙ¸öʵÀý
    A () {num++};    //    Ã¿´´½¨Ò»¸öʵÀý£¬¾ÍÈÃnum×ÔÔö1
    //    ·µ»Øͨ¹ý¹¹Ô캯ÊýËù´´½¨¹ýµÄAÀàʵÀýµÄÊýÄ¿
    static int how_many_instance() {
        return num;
    }
}
static A::num = 0;    //    ÐèÒªÔÚÀàÉêÃ÷µÄÍⲿµ¥¶À³õʼ»¯£¡
int main() {
    cout << A::how_many_instance() << endl;
    A a, b, c, d;
    cout << A::how_many_instance() << endl;
 


Ïà¹ØÎĵµ£º

C Runtime LibraryÀ´Àú, API, MFC, ATL¹Øϵ

תÔØ×Ô£ºhttp://www.cnblogs.com/chio/archive/2007/11/26/972152.html
 
CRTÔ­ÏÈÊÇÖ¸Microsoft¿ª·¢µÄC Runtime Library£¬ÓÃÓÚ²Ù×÷ϵͳµÄ¿ª·¢¼°ÔËÐС£ºóÀ´ÔÚ´Ë»ù´¡ÉÏ¿ª·¢ÁËC++ Runtime Library£¬ËùÒÔÏÖÔÚCRTÊÇÖ¸Microsoft¿ª·¢µÄC/C++ Runtime Library¡£ÔÚVCµÄCRT/SRCĿ¼Ï£¬¿ÉÒÔ¿´µ½CRTµÄÔ´Â룬²»½öÓÐCµÄ£¬Ò²ÓÐC++µ ......

Java "ÓÐÀíÓÉ" ±È C++ ¿ì

Java "ÓÐÀíÓÉ" ±È C++ ¿ì
 
×î½üÉÏCSDN±È½Ï¶à£¬ÓÖ¿´µ½ËµJava±ÈC++¸ü¿ìµÄÌû×Ó¡£
JavaÔÚijЩÇé¿öϱÈC++¿ìÎÒÈÏΪÊǺÜÓеÀÀíµÄ¡£ÀýÈç¿ÉÒÔ¸ù¾ÝÌض¨µÄCPU½øÐÐÓÅ»¯µÈµÈ¡£
ÓÐλ½Ð wingfiring(±ð¶ºÁË)(·ÇµäÐÍͺ×Ó) µÄÀÏÐÖ·¢ÁËÒ»¸öÌû×Ó£¬Ô­ÎÄÈçÏ£º
ºÃ£¬ÎÒûÄÇô¶àʱ¼ä³³C++ºÃ»¹ÊÇJavaºÃ£¬ËùÒÔ£¬ÎÒ¾ÍÏÈÕ°ÑöÒ»ÏÂÂ¥Ö÷¸ø³öµÄÁ ......

Space C 2.1.2 ·¢²¼

--------Éý¼¶ Space C V2.1.2
2010.2.16
*½«Èí¼þ½çÃæ·ç¸ñÐÞ¸ÄΪ¸úËæWindowsϵͳ£¬ÃÀ»¯ÁËÈí¼þ½çÃ棬ʹ¿ª·¢¹ý³Ì¸üÊæÐÄ¡£
*½«DOXBoxÐéÄâµÄ¿ªÆô/¹Ø±Õ£¬¸ü¸Äµ½±àÒëÅäÖеÄTC2.0Ò³Ãæ¡£
*Ôö¼Ó‘СÓïÑÔ’Tiny µÄ±àÒëÆ÷-Smmy£¬²¢¸½´øDOS°æµÄTMMY_DOSÐéÄâ»ú¡£
*Ôö¼Ó‘СÓïÑÔ’Tiny µÄ¶ÔÓ¦Windows°æÐéÄâ»úTMMY ......

WindowsÏÂÓÃEclipse´î½¨C/C++¿ª·¢»·¾³

±¾Îļٶ¨ÄãÒѾ­ÊìϤJava,EclipseµÄ°²×°,²¢ÄÜ˳ÀûÆô¶¯ºÍÔËÐÐEclipse.´ËÍâÒòΪ¸÷Èí¼þ°æ±¾ÔÚ²»¶Ï¸üУ¬ÓÐЩµØ·½¿ÉÄܲ»×¼È·£¬ÒÔ×îеġ¢Ô­ÎÄ×ÊÁÏΪ׼¡£ 
¾àÉÏÒ»´ÎдºÍµ÷C++³ÌÐò£¬ÒѾ­5¡¢6ÄêÁË£¬¹âÒõÜóÜÛËêÔÂÎÞÇ飬ÏÖÔÚÔÙÖØÐÂÊ°ÆðÀ´£¬ºÜ¶à¶«Î÷¶¼Òª´ÓÍ·À´¡£WindowsÏÂC/C++µÄIDEÓкܶ࣬ÎÒÖªµÀµÄ¾ÍÓÐMS Visual Studio£¬Borla ......

"C Run Time Error R6034"£¨×ª£©


Regarding C Run-Time Error R6034 for VS2005/VS2008
Regarding "C Run-Time Error R6034"
Microsoft's recommendation is very confusing. That is, it recommends to include a manifest file and to re-compile the project.
I recently had a problem with 'R6034' error message even with a manifest file ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ