c signalµ÷ÓÃÎÊÌâ
¿ªÊ¼Ñ§OS,°´Á·Ï°ÒªÇóдµÄ´úÂëÔÚgccÏÂÎÞ·¨±àÒ룺
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
void SIGFPEhandler2(int sig1) {
printf("1");
signal(SIGFPE, SIGFPEhandler1);
exit(EXIT_SUCCESS);
}
void SIGFPEhandler1(int sig2) {
signal(SIGFPE, SIGFPEhandler2);
printf("2");
exit(EXIT_SUCCESS);
}
int DBZ(int i) {
return i/0;
}
int main(void) {
(void) signal(SIGFPE, SIGFPEhandler1);
DBZ(5);
return EXIT_SUCCESS;
}
Ä¿µÄÈÃsignal handlerµ÷ÓÃÁíÒ»¸ö handler£¬¶¼ÊÇ´¦ÀíͬÑùµÄsignal¡£±àÒëÌáʾSIGFPEhandler1 undeclare.
ÊÇÎÒʵÏֵķ½·¨²»¶Ô»¹ÊÇhandler²»Äܵ÷Óô¦ÀíͬÑùsignalµÄhandler? Íû´ó¼ÒÖ¸Õý¡£
ÔÚlinuxÏÂÂð£¿
windowsÏÂ, ÓõÄCygwin.
ÔÚSIGFPEhandler2 Ç° ÉùÃ÷ SIGFPEhandler1
º¯ÊýȱÉÙÇ°ÖÃÉùÃ÷
¼Ó
void SIGFPEhandler1(int sig2);
void SIGFPEhandler2(int sig1);
ÔÚÎļþÍ·ºó
±àÒë²»ÄÜͨ¹ý£¬ SIGFPEhandler2 undeclared.
Ïà¹ØÎÊ´ð£º
RT
c³ÌÐòÉè¼ÆÓïÑÔ
C³ÌÐòÉè¼Æ̶ºÆÇ¿µÄÄDZ¾
c³ÌÐòÉè¼ÆÓïÑÔ
cÏÝÚåÓëȱÏÝ
CºÍÖ¸Õë
C primer plus
cר¼Ò±à³Ì
CÓïÑÔÖ®ËÄÊéÎå¾
ǧÍò²»Òª¿´Ì·ºÆÇ¿µÄ£¬»áº¦ËÀÄã¡£
Ö±½Ó¿´The C Programming Lang ......
GCCÊÇÃâ·ÑµÄÂð£¿ÄÇÓУ¿
LINUXϵͳÔõôװ£¿
ÖÐÎÄÔõôÉèÖã¿
Äã×°ÍêLinuxϵͳ¾Í»á×Ô´øGCC£¬windowsÏÂÒ²ÓÐGCC£¬±ÈÈçdev-c++,CODE::Blocks
linuxϵͳ°²×°¸ù¾Ý²»Í¬µÄlinux°æ±¾ÍøÉ϶¼Óн̳̣¬¿´ÏÂ¾Í ......
ÇëÎÊÏÂC/SµÄÎïÀí½á¹¹£¬ÊDz»ÊÇÕâÑùµÄ£º
һ̨·þÎñÆ÷£¬ÉÏÃæÖ»ÔËÐÐÒ»¸öÊý¾Ý¿â£¬È»ºóÊǶà¸ö¿Í»§¶Ë»ú£¬Ã¿¸ö»ú×ÓÉÏ°²×°Ò»¸ö¿Í»§¶ËÈí¼þ£¬ÔÙ°ÑÊý¾Ý¿âÁ¬½ÓÓû§ÃûÃÜÂë¸øÿ¸ö¿Í»§¶Ë£¬Õâ¸öÃÜÂëÓÉÈí¼þ¼ÓÃÜ·ÅÔÚ¿Í»§¶Ë£¬Óû§µ ......
QQȺ 29152388
ÓÑÇéUP
°ï¶¥
up
°ïup
up Ö§³Ö£¡
up jf
...ÄѵÀÓзÖ..?
up up up
Ï£ÍûÓеüӷ֣¬¹þ¹þ¡£
Ö§³Ö£¬ÎÒ¼ÓÁË£¬Ï£ÍûÂ¥Ö÷ÄܼÓÎÒ£¬¹²Í¬Ñ§Ï°¹þ
¼ÓÁË¡£
¶¥ÉÏ£¬Ã¿ÌìÊÕ»ñÒ»µã£¬Ö§³Ö ......
c/s ºÍb/s µÄÇø±ðÊÇʲô£¬c/sÐèÒª·þÎñÆ÷Âð£¬ÔõôÅжϳÌÐòÊÇc/s »¹ÊÇb/s
C/SÊÇ·þÎñÆ÷ºÍ¿Í»§¶Ë B/SÊÇ·þÎñÆ÷ºÍä¯ÀÀÆ÷
ËûÃǶ¼ÓÐs£¬Ê²Ã´ÊÇs?¾ÍÊÇserver
ÄÇËûÃǵÄÇø±ðÊÇʲô£¿Ò»¸öÊÇc£¬¼´client£¬Ò»¸ö ......