¡¾C/C++¡¿C++ÐéÎö¹¹º¯ÊýµÄ×÷ÓÃ
1¡¢×÷ÓÃ
ΪÁËÔÚʵÏÖ¶à̬µÄʱºò²»Ôì³ÉÄÚ´æй¶,
Èç¹û»ùÀàÎö¹¹º¯ÊýÇ°²»¼Óvitual£¬ÅÉÉúÀà¶ÔÏó±»Ïú»Ùºó£¬Ö»»áµ÷ÓûùÀàµÄÎö¹¹º¯Êý£¬¶ø²»»áÈ¥µ÷ÓÃÅÉÉúÀàµÄÎö¹¹º¯Êý¡£
2¡¢¶ÔÓÚÕý³£µÄº¯Êý£¬Èç¹û»ùÀàÖÐÉùÃ÷Ϊvirtual£¬ÔòÅÉÉúÀà¿ÉÒÔ²»ÓÃÔÙдvirtual
// CPPTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
class Base
{
public:
Base(){}
virtual ~Base()
{
printf("Base Destructor!\n");
}
virtual void Func()
{
printf("Base Func!\n");
}
private:
int m_iData;
};
class Derived : public Base
{
public:
Derived(){}
~Derived()
{
printf("Derived Destructor!\n");
}
void Func()
{
printf("Derived Func!\n");
}
};
class Derived2 : public Derived
{
public:
Derived2(){}
~Derived2()
{
printf("Derived2 Destructor!\n");
}
void Func()
{
printf("Derived2 Func!\n");
}
};
int main(int argc, char* argv[])
{
Base *pb = new Base;
pb->Func();
Base *pd = new Derived;
pd->Func();
Base *pd2 = new Derived2;
pd2->Func();
delete pb;
delete pd;
delete pd2;
return 0;
}
½á¹û£º
Base Func!
Derived Func!
Derived2 Func!
Base Destructor!
Derived Destructor!
Base Destructor!
Derived2 Destructor!
Derived Destructor!
Base Destructor!
Ïà¹ØÎĵµ£º
VC++ÖÐʹÓÃADO·½Ê½²Ù×÷ACCESSÊý¾Ý¿â
תÔØ£ºhttp://www.programbbs.com/doc/3078.htm
ADO(ActiveX Data Object)ÊÇMicrosoftÊý¾Ý¿âÓ¦ÓóÌÐò¿ª·¢µÄнӿڣ¬Êǽ¨Á¢ÔÚOLE DBÖ®Éϵĸ߲ãÊý¾Ý¿â·ÃÎʼ¼Êõ£¬¼´Ê¹Äã¶ÔOLE DB£¬COM²»Á˽âÒ²ÄÜÇáËɶԸ¶ADO,ÒòΪËü·Ç³£¼òµ¥Ò×Óã¬ÉõÖÁ±ÈÄãÒÔÍùËù½Ó´¥µÄODBC API¡¢DAO¡¢RDO¶¼ÒªÈÝÒ×ʹÓ㬲¢² ......
»ªÇåÔ¶¼û 2010-01-22 09:21 ×÷ÕߣºÍõæ©æ©,»ªÇåÔ¶¼ûǶÈëʽѧԺ½²Ê¦¡£
ÔÚǶÈëʽ¿ª·¢ÖУ¬×÷Ϊµ×²ã¿ª·¢Õߣ¬¸ü¿´ÖصÄÊÇCÓïÑԵıà³ÌÄÜÁ¦£¬µ«×÷ΪӦÓóÌÐòµÄ¿ª·¢Õߣ¬ÎÒÏëѧϰC++»¹ÊÇÓбØÒªµÄ¡£ÄãÖ»ÓÐÔÚÁ˽âÁË£Ã++µÄÌØÐÔ£¬´Ó±¾ÖÊÉÏ¿´µ½ËüÓëCµÄÇø±ð²ÅÄܼᶨÄãÈÏʶѧϰËüµÄ¾öÐÄ¡£ÎÒ²»ÊÇ× ......
¹¤×÷ºóÎÒ×ÐϸÔĶÁÁ˹«Ë¾µÄ3DÒýÇæµÄÔ´´úÂ룬ÕâÊÇ¿îά»¤ÁËÊ®¼¸ÄêµÄÒýÇ棬Ö÷ÒªÔËÐÐÔÚXBox, PS3ºÍPCƽ̨ÉÏ¡£ºËÐIJ¿·ÖÓÃCÓïÑÔд£¬ÆäËû²¿·Ö×é¼þÓÃC++±àд¡£ÎÒÒÔÇ°ºÜÉÙÓÃCÓïÑÔ±à³Ì(°Ý´óѧ½ÌÓýËù´Í)£¬µ«¶ÁÁËÌ«¶àÕâ¿îÒýÇæµÄ´úÂëÉîÉîµÄÖÐÁËCÓïÑԵĶ¾¡£C¸øÎҵĸоõ¾ÍÊǼòµ¥Ã÷ÁË£¬Òª½â¾öÎÊÌâ¾ÍÊÇÖ±½ÓÈ¥½â¾öËü£¬¾ø²»¹ ......
1¡¢int 4×Ö½Ú
long 8×Ö½Ú
float 4×Ö½Ú
double 8×Ö½Ú
long double 16×Ö½Ú
2¡¢Ò»¸ö×Ö·û±äÁ¿Ö»ÄÜ´æ·ÅÒ»¸ö×Ö·û¡¢Ò»¸ö×Ö½Ú´æ·ÅÒ»¸ö×Ö½Ú
char c;
c = 'a'; c = '\034' ......