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

C³ÌÐò£º¿´ËƼòµ¥


pFn¡¡t1(void);
pFn¡¡t2(void);
int main()
{
¡¡¡¡pFn fn = t1 ;
¡¡¡¡while(1){
¡¡¡¡¡¡¡¡fn = fn();¡¡¡¡//Õâ¸ö£¬´ó¼Ò¿´Çå³þÁË
¡¡¡¡}
}
pFn¡¡t1()
{
¡¡¡¡printf("t1\n");
¡¡¡¡return t2 ;
}
pFn¡¡t2()
{
¡¡¡¡printf("t2\n");
¡¡¡¡return t1 ;
}
ÇëÎÊ£¬Ïëͨ¹ý±àÒ룬pFnº¯ÊýÖ¸ÕëÀàÐÍÔõô¶¨Ò壿
×¢Ã÷һϣºpFnÊÇÒ»ÖÖ·µ»Ø±¾º¯ÊýÀàÐÍÖ¸ÕëµÄº¯ÊýÖ¸Õë¡£


Ïà¹ØÎĵµ£º

C/C++ÖпÕÖ¸ÕëÓë0ÓëNULLºÍÆäËûÈô¸ÉÎÊÌâС½á

ʲôÊÇ¿ÕÖ¸Õë³£Á¿£¨null pointer constant£©?
[6.3.2.3-3] An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.
ÕâÀï¸æËßÎÒÃÇ£º0¡¢0L¡¢'\0'¡¢3 - 3¡¢0 * 17 £¨ËüÃǶ¼ÊÇ“integer constant expression”£©ÒÔ¼° (void*)0 µÈ¶¼ÊÇ¿Õ ......

extern "C"

Èç¹ûC++µ÷ÓÃÒ»¸öCÓïÑÔ±àдµÄ.DLLʱ£¬µ±°üÀ¨.DLLµÄÍ·Îļþ»òÉùÃ÷½Ó¿Úº¯Êýʱ£¬Ó¦¼Óextern "C" {¡¡}¡£
È磺
Í·ÎļþcExample.h
#include <stdio.h>
#ifndef C_EXAMPLE_H
#define C_EXAMPLE_H
int add(int x,int y);
#endif

º¯ÊýʵÏÖÎļþcExample.c(×¢ÒâÊÇ.cÎļþ)
#include<stdio.h>
#include "cExample ......

Cº¯Êýµ÷ÓÃÔ¼¶¨

CÖвÉÓÃÁ˲»Í¬µÄµ÷Ó÷½Ê½À´µ÷Óú¯Êý£¬ÕâÀïµÄº¯Êýµ÷ÓøÅÄî¿ÉÄÜÓëÎÒÃÇͨ³£ËùÀí½âµÄº¯Êýµ÷ÓÃÓÐËù²»Í¬£¬ËüÃÇÖ¸µÄÊÇ´¦ÀíÆ÷ÔÚ´¦Àíº¯ÊýÉϵIJîÒì¡£Àí½âÕâЩ²»Í¬µÄ·½Ê½ÓÐÖúÓÚÎÒÃÇÀ´µ÷ÊÔ³ÌÐòºÍÁ´½ÓÎÒÃǵĴúÂë¡£ÔÚ´ËÎÒÏëÌÖÂÛÒ»ÏÂÖ÷ÒªµÄËÄÖÖº¯Êýµ÷Ó÷½·¨ÒÔ¼°Ö®¼äµÄÇø±ð£¬ËüÃÇÊÇ__stdcall¡¢__cdecl¡¢__fastcall¡¢thiscall¡£µ±È»£¬»¹ÓÐһР......

50¸öc/c++Ô´´úÂëÍøÕ¾(תÔØ£©

source: http://blog.renren.com/blog/229071289/443686923
C/C++ÊÇ×îÖ÷ÒªµÄ±à³ÌÓïÑÔ¡£ÕâÀïÁгöÁË50ÃûÓÅÐãÍøÕ¾ºÍÍøÒ³Çåµ¥£¬ÕâЩÍøÕ¾Ìṩc/c++Ô´´úÂë¡£Õâ·ÝÇåµ¥ÌṩÁËÔ´´úÂëµÄÁ´½ÓÒÔ¼°ËüÃǵÄС˵Ã÷¡£ÎÒÒѾ¡Á¦°üÀ¨×î¼ÑµÄC/C++Ô´´úÂëµÄÍøÕ¾¡£Õâ²»ÊÇÒ»¸öÍêÕûµÄÇåµ¥£¬ÄúÓн¨Òé¿ÉÒÔÁªÏµÎÒ£¬ÎÒ½«»¶Ó­ÄúµÄ½¨Ò飬ÒÔ½øÒ»²½¼ÓÇ¿Õâ·½Ãæ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ