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ÊÇÒ»ÖÖ·µ»Ø±¾º¯ÊýÀàÐÍÖ¸ÕëµÄº¯ÊýÖ¸Õë¡£
Ïà¹ØÎĵµ£º
main.c
//³õʼ»¯¶ÓÁÐ
void InitQueue(LiQueue *q)
{
q=(LiQueue*)malloc(sizeof(LiQueue));
q->front=q->rear=NULL;
}
//ÅжÏÊÇ·ñΪ¿Õ
int QueueEmpty(LiQueue *q)
{
if(q->rear==NULL)
{
return 1;
}
else
{
......
ʲôÊÇ¿ÕÖ¸Õë³£Á¿£¨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 µÈ¶¼ÊÇ¿Õ ......
µ¥Àýģʽ£º¶ÔÓ¦Ò»¸öÀàÖ»ÄÜÉú³ÉÒ»¸ö¶ÔÏó¡£
#include <stdio.h>
class A
{
private:
int id;
A() {}//°Ñ¹¹Ô캯Êý·ÅÔÚprivate£ºÏÂÄ¿µÄÊÇÔÚÀàÍâ²»ÄÜÔÚÕ»ÉÏÖ±½Ó·ÖÅä¿Õ¼ä¶¨Òå¶ÔÏó¡£
public:
static A *pt;
static A *instance()
  ......
Èç¹ûÒª¼ÓÈë´Ë¼Æ»®:
1¡¢
·½Ê½1
£º¼ÓÈë
QQ
Ⱥ£º
93684322
¡£
2¡¢
·½Ê½2
£º¼ÓÈë
CSDN
Ⱥ×飺
DS¼Æ»®
¡£
1.1 ±äÁ¿´æ´¢Óò
1.1.1 Ò»¸öʾÀý
pang123huiÊ×ÏÈÌṩÁËÒ»¸öÍøÉÏÁ÷´«µÄѧϰ´úÂëʾÀý£º
int a = 0; //È«¾ÖÇø
void main()
{
int b; //Õ»
char s[] = “abc” ......
Linux C¡¡¡¡alarmº¯Êý---Çë¿´×îºó
¡¡¡¡alarmÒ²³ÆÎªÄÖÖÓº¯Êý£¬Ëü¿ÉÒÔÔÙ½ø³ÌÖÐÉèÖÃÒ»¸ö¶¨Ê±Æ÷£¬µ±¶¨Ê±Æ÷Ö¸¶¨µÄʱ¼äµ½Ê±£¬ËüÏò½ø³Ç·¢ËÍSIGALARMÐźš£Òª×¢ÒâµÄÊÇ£¬Ò»¸ö½ø³ÌÖ»ÄÜÓÐÒ»¸öÄÖÖÓʱ¼ä£¬Èç¹ûÔÚµ÷ÓÃalarm֮ǰÒÑÉèÖùýÄÖÖÓʱ¼ä£¬ÔòÈκÎÒÔǰµÄÄÖÖÓʱ¼ä¶¼±»ÐÂÖµËù´úÌæ¡£
ËùÐèÍ·Îļþ
¡¡¡¡#include<unistd.h>
º¯Ê ......