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

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 Ç° ÉùÃ÷ SIGFPEhandler1

±àÒë²»ÄÜͨ¹ý£¬ SIGFPEhandler2 undeclared.

ÒýÓÃ
º¯ÊýȱÉÙ


Ïà¹ØÎÊ´ð£º

СCµÄÎÊÌâ¹þ

C/C++ code:
#include <stdio.h>
typedef struct node{
int *key;
int length;
}node;
void insert(node &temp,int n)
{
int i,j;
for(i=0;i<=temp.length;i++)
{
......

Ò»¸ö¼òµ¥µÄcÓÎÏ·

13¸öÈËΧ³ÉһȦ£¬´ÓµÚÒ»¸öÈË¿ªÊ¼Ë³Ðò±¨ºÅ1£¬2£¬3¡£·²±¨µ½3ÕßÍ˳öȦ×Ó£¬ÕÒ³ö×îºóÁôÔÚȦ×ÓÖеÄÈËÔ­À´µÄÐòºÅ
½á¹ûÓ¦¸ÃÊÇ13 ¿ÉÎҵijÌÐòµÄ½á¹ûÊÇ11 Ï£ÍûºÃÐÄÈË°ï¸ÄÒ»ÏÂ
#include <stdio.h>
#include < ......

c LINUX ÎÊÌâ

GCCÊÇÃâ·ÑµÄÂð£¿ÄÇÓУ¿

LINUXϵͳÔõôװ£¿


ÖÐÎÄÔõôÉèÖã¿
Äã×°ÍêLinuxϵͳ¾Í»á×Ô´øGCC£¬windowsÏÂÒ²ÓÐGCC£¬±ÈÈçdev-c++,CODE::Blocks
linuxϵͳ°²×°¸ù¾Ý²»Í¬µÄlinux°æ±¾ÍøÉ϶¼Óн̳̣¬¿´ÏÂ¾Í ......

CÎļþ¶Áд

char data[255]={0},user[15],password[32];

if((fp=fopen("QQ.ini","wb+"))==NULL)
{
printf("ÎÞ·¨´´½¨QQ.iniÎļþ\n");
system("pause");
exit(0); ......

ѧϰÌÖÂÛ C/C++ QQȺ - C/C++ / ·Ç¼¼ÊõÇø

QQȺ 29152388
ÓÑÇéUP

°ï¶¥

up

°ïup

up Ö§³Ö£¡

up jf

...ÄѵÀÓзÖ..?

up up up
Ï£ÍûÓеüӷ֣¬¹þ¹þ¡£

Ö§³Ö£¬ÎÒ¼ÓÁË£¬Ï£ÍûÂ¥Ö÷ÄܼÓÎÒ£¬¹²Í¬Ñ§Ï°¹þ

¼ÓÁË¡£

¶¥ÉÏ£¬Ã¿ÌìÊÕ»ñÒ»µã£¬Ö§³Ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ