´¿CʵÏÖc++Àà
//#include "stdafx.h"
/*
ÃèÊö:´¿cÄ£ÄâÀà,´¿c±àдc++Àà,´¿cʵÏÖc++ÀàµÄ¼òµ¥·¶Àý,½á¹¹Ä£ÄâÀà,struct ±àдclass.
c±àдÀàÊÇʵÏÖ´¿c±àдcom×é¼þµÄ»ù´¡¡£
*/
#include <stdio.h>
typedef struct _Vtbl
{
void (*AddRef)(struct CObject* obj,int);//ËùÓеĺ¯ÊýµÄµÚÒ»¸ö²ÎÊýÀàËÆclassµÄÒþÄäµÄthisÖ¸Õë
void (*Release)(struct CObject* obj);
}Vtbl;//º¯ÊýÖ¸ÕëÊý×é
typedef struct CObject
{
Vtbl vtbl;//º¯ÊýÖ¸ÕëÊý×éÖ¸Ïò³ÉÔ±º¯Êý
int a;
int b;
}Cobj;//½á¹¹Ä£ÄâÀàµÄ¼òµ¥¶¨Òå
void fun1(Cobj *obj,int count)//³ÉÔ±º¯Êý
{
obj->a+=count;
printf("CObject::a=%d\n",obj->a);
}
void fun2(Cobj *obj)//³ÉÔ±º¯Êý
{
obj->a--;
printf("CObject::a=%d\n",obj->a);
}
static Vtbl vt={fun1,fun2};//ÉùÃ÷Ò»¸ö¾²Ì¬º¯ÊýÖ¸ÕëÊý×é
int main()
{
Cobj obj;//¶¨Òå¶ÔÏó
obj.vtbl=vt;
obj.a= 10;
obj.vtbl.AddRef(&obj,1);
obj.vtbl.Release(&obj);
return 0;
}
Ïà¹ØÎĵµ£º
¸ãÁ˼¸ÌìµÄÎÊÌâ¡£±àÒëÒ»¸öÎļþʱ,ÀÏÊdzöÏÂÃæÕâ¸ö´í.
checking for C compiler default output file name… configure: error: C compiler cannot create executables
û·¨×Ó,ÕÒ¸ßÈË°ïÎÒ´¦Àí,¹þ¹þ….¼Ç¼ÏÂÀ´.ÒòΪ64λµÄ»úÆ÷£¬Ä¬È϶ÔCFLAGSµÄÕâÊǽøÐÐÁËÉèÖÃ,ËùÒÔʹÓÃÏÂÃæµÄÃüÁîÇå¿ÕËû¾ÍÐÐÁË£¬ÕâÑùÈí¼þ¾Í²»»á±¨ ......
µÚÒ»²¿·ÖÈí¼þ±à³ÌµÄʱ¼ä·ÖÅä¸Å¿ö
¸ßЧÂʵijÌÐòÔ±²¢²»ÊÇÇüüÅ̵ÄËٶȱȱðÈ˿죬¶øÊÇËûÓÐ×ÅÁ¼ºÃµÄ±à³ÌÏ°¹ß£¬½ÚÊ¡Á˱ðÈËÀ˷ѵÄʱ¼ä¡£Òò´Ë£¬ÒªÏëÌá¸ß×Ô¼ºµÄ±à³ÌЧÂÊ£¬¸ù±¾ÔÚÓÚÔõôÉÙÀË·Ñʱ¼ä¡£Ö»ÒªÄܰѱðÈËÀ˷ѵÄʱ¼ä½ÚÊ¡ÏÂÀ´£¬ÄãµÄЧÂʾͿÉÒÔ¿ì¹ý±ðÈË£¬ÉõÖÁÊý±¶ÓÚ±ðÈË¡£ÒªÏë½Úʡʱ¼ä£¬µ±È»Ê×ÏÈÐèÒªÃ÷°×±à³ÌÖкķ ......
C#ÀࣺÀàÊÇC# Öй¦ÄÜ×îΪǿ´óµÄÊý¾ÝÀàÐÍ£¬ÀàÒ²¶¨ÒåÁËÊý¾ÝÀàÐ͵ÄÊý¾ÝºÍÐÐΪ¡£È»ºó£¬³ÌÐòÔ±¿ÉÒÔ´´½¨×÷Ϊ´ËÀàµÄʵÀýµÄ¶ÔÏó¡£
C#½á¹¹Ì壺½á¹¹ÌåÊÇÇáÁ¿Ð͵ÄÀ࣬ʹÓÿªÏúÏà¶ÔÓÚÀà½ÏС¡£
C#ÀàºÍC#½á¹¹ÌåÁ½ÕߵĹØϵ£º
1.Êý¾ÝÀàÐÍ£ºÀàºÍ½á¹¹Ì嶼ÊÇÊý¾ÝÀàÐÍ£¬ÀàÊÇÒýÓÃÀàÐÍ£¬½á¹¹ÌåÊÇÖµÀàÐÍ¡£
2.¼Ì³ÐÐÔ£ºÀà¿ÉÒԼ̳кͱ»¼Ì³Ð£¬¶ø½á¹ ......
µ±Òª½»»»Á½¸öÊýµÄֵʱ£¬Í¨³£µÄ×ö·¨ÊǶ¨ÒåÒ»¸öÁÙʱ±äÁ¿£¬È»ºóÔÙ½øÐн»»»¡£ÄÇôÄܲ»Äܲ»ÓÃÁÙʱ±äÁ¿¶ø½»»»Á½¸öÊýµÄÖµÄØ£¿¿ÉÒԵģ¡CÓïÑÔÌṩµÄÒì»òÔËËã¾Í¿ÉÒÔʵÏÖÕâÑùµÄ²Ù×÷¡£
Òì»òÔËËã·û^Ò²³ÆXORÔËËã·û£¬ËüµÄ¹æÔòÊÇÈô²Î¼ÓÔËËãµÄÁ½¸ö¶þ½øλͬºÅ£¬Ôò½á¹ûΪ0£¨¼Ù£©£»ÒìºÅΪ1£¨Õ棩¡£¼´0 ^ 0 = 0, 0 ^ 1 = 1, 1 ^ 0 = 1, ......
#include <windows.h>
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd )
{
OPENFILENAME ofn;
//ÔÚÄÚ´æÖпª±ÙÒ»¿é¿Õ¼ä£¬´æ·ÅÓû§Ñ¡È¡µÄÎļþÃû
char szFile[MAX_PATH];//MAX_PATH ......