²¶»ñctrl+cÐźÅÁ¿
#include<signal.h>
#include<stdio.h>
void ctrlhandler( int a )
{
printf("you have press ctrl+c \n");
/* close Ïà¹Ø²Ù×÷*/
getchar();
exit(0);
}
int main()
{
signal(SIGINT,ctrlhandler);
/*ÆäËû²Ù×÷*/
getchar();
return 1;
}
Ïà¹ØÎĵµ£º
1.int *p1 = *(int **)p2;
Õâ¸ö±í´ïʽ½«p2Ö¸ÏòµÄÖµµ±×öÖ¸ÕëÀàÐ͸³Öµ¸øp1
£¬½«ÆÕֵͨµ±×öÖ¸ÕëֵʹÓÃ
2.*£¨int **£©p1 = p2£»
Õâ¸ö±í´ïʽ½«p1Ö¸ÏòµÄÖµÐÞ¸ÄΪµÄp2±£´æµÄÖ¸Õë
µÄÖµ£¬½«Ö¸Õëµ±×öÆÕֵͨʹÓÃ
ÕâÊǽñÌì¿´us/OSµÄÄÚ´æ¹ÜÀíµÄʱºò¿´µ½µÄ£¬ÕæÊÇÌ«¾«±ÙÁË
°¦£¬¿´À´×Ô¼ºµÄ¼ûʶ»¹ÊÇÌ«ÉÙÁË£¬ÒÔºóµÃ¼Ó±¶Å ......
Á´±íÖÐÓÐÁ½¸ö¹Ø¼üµÄ²Ù×÷£º´´½¨ºÍɾ³ý¡£½ñÌìÎҾͶÔÕâÁ½¸ö²Ù×÷½øÐнéÉÜ£¬
´ÓÕâÁ½¸ö²Ù×÷ÖÐѧϰµ½Á´±íµÄ»ù±¾Ó÷¨¡£
1. Create
Create() ÊÇÒ»¸öÁ´±í»ù´¡£¬Ö»Óн¨Á¢ºÃÁ´±í²ÅÄܶÔËü½øÐÐÏàÓ¦µÄ²éÕÒ£¬É¾³ý µÈ¡£
»ù±¾Ëã·¨£º
1.³õʼ»¯
head=NULL;
......
Chapter 1: Thread
¢Ù thread functions
1. pthread_self();
2. thread existing
you can get the value of rval_ptr just by pthread_join(pthread_t tht, void ** rval_ptr)
cancel a thread as the thread exits with PTHREAD_CANCELED in pthread_exit, this functio ......
1.
ÒýÑÔ
¡¡¡¡C++
ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”
£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++
ÖÐÀàËÆC
ÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëC
ÓïÑÔÍêÈ«Ïàͬ¡£×÷ ΪһÖÖÓûÓëC
¼æÈݵÄÓïÑÔ£¬C++
±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌص㣨±»ÊÀÈ˳ÆΪ“
²»³¹µ×µØÃæÏò¶ÔÏó”
£©£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚ ......
´ÓÌìÌÃ×ßÏòµØÓüµÄÁù²¿... 1
µÚÒ»²½¡¢°Ñfor±ä³Éwhile. 2
µÚ¶þ²½£¬°ÑÑ»µ±ä³ÉµÝ¹é... 2
µÚÈý²½£¬ÅªÂÒ´úÂë½á¹¹/ʹÓÃûÓк¬ÒåµÄ±äÁ¿Ãû... 3
µÚËIJ½£¬È¡ÏûÁÙʱ±äÁ¿... 3
µÚÎå²½£¬¼ÌÐøŪÂÒ±äÁ¿Ãû... 4
µÚÁù²½£¬ÒƳý³£Á¿... 4
´ÓÌìÌÃ×ßÏòµØÓüµÄÁù²¿
¿ªÊ¼³ÌÐò
ÏÂÃæÊÇÒ»¸öÕÒ³öËØÊýµÄ³ÌÐò£º
²é¿´Ô´´úÂë´òÓ¡ ......