-
201.
0
-
202.
0/* Fig. 14.8: fig14_08.cTümünü Göster
Using signal handling */
1. include <stdio.h>
2. include <stdlib.h>
3. include <signal.h>
4. include <stdlib.h>
5. include <time.h>
void signalHandler( int signalValue ); /* prototype */
int main()
{
int i; /* counter used to loop 100 times */
int x; /* variable to hold random values between 1-50 */
signal( SIGINT, signalHandler ); /* register signal handler */
srand( clock() );
/* output numbers 1 to 100 */
for ( i = 1; i <= 100; i++ ) {
x = 1 + rand() % 50; /* generate random number to raise SIGINT */
/* raise SIGINT when x is 25 */
if ( x25 ) {
0 ) {
raise( SIGINT );
} /* end if */
printf( "%4d", i );
/* output n when i is a multiple of 10 */
if ( i % 10
printf( "n" );
} /* end if */
} /* end for */
printf("nn");
system("pause");
return 0; /* indicates successful termination */
} /* end main */
/* handles signal */
void signalHandler( int signalValue )
{
int response; /* user's response to signal (1 or 2) */
printf( "%s%d%sn%s",
"nInterrupt signal ( ", signalValue, " ) received.",
"Do you wish to continue ( 1 = yes or 2 = no )? " );
scanf( "%d", &response );
/* check for invalid responses */
while ( response != 1 && response != 2 ) {
printf( "( 1 = yes or 2 = no )? " );
scanf( "%d", &response );
} /* end while */
/* determine if it is time to exit */
if ( response == 1 ) {
/* reregister signal handler for next SIGINT */
signal( SIGINT, signalHandler );
} /* end if */
else {
exit( EXIT_SUCCESS );
} /* end else */
} /* end function signalHandler */
/***
* (C) Copyright 1992-2004 by Deitel & Associates, Inc. and *
* Pearson Education, Inc. All Rights Reserved. *
* *
* DISCLAIMER: The authors and publisher of this book have used their *
* best efforts in preparing the book. These efforts include the *
* development, research, and testing of the theories and programs *
* to determine their effectiveness. The authors and publisher make *
* no warranty of any kind, expressed or implied, with regard to these *
* programs or to the documentation contained in these books. The authors *
* and publisher shall not be liable in any event for incidental or *
* consequential damages in connection with, or arising out of, the *
* furnishing, performance, or use of these programs. *
***/ - 203.
-
204.
0Selin Şekerci
- 205.
-
206.
0colt m1911a1
- 207.
-
208.
0ininger Hotel Brussels City Center
-
209.
0kardeş sen yapamıyorsun olmuyor. o tadı alamıyoruz.
mizahın zayıf.
algın alt sınırda sürünüp gidiyor.
cırpınıyor gibisin.
gibtirip gitmelisin
huurnun cekip cıkarttıgı seni - 210.
- 211.
- 212.
-
213.
0
- 214.
-
215.
0
-
216.
0reserved
-
217.
019 tane sevgilim var ayrıca ateistim çok fena sorgularım. günde 73 paket marlboro içerim. günlük harçlığım 579 lira.17 sene kung fu yaptım.21 sene profesyonel futbol oynadım. babam fbı da ajan. facebookta 478 milyar bin 978 tane takipçim ve 5000 arkadaşım var.aog da adminim hepinizden üstünüm
-
218.
0spamlayın https://twitter.com/an_Lc_n
- 219.
- 220.
-
vikingsten ddos acıklaması
-
michael scofield pb adlı yazarımsıyı vurma kararı
-
piyo yalvaririm agzina al
-
10 tl ye taşak döneri olsa yermiydiniz
-
meme yok vucut ipince
-
ekşi sözlük abartılmış balon bir sözlüktür
-
ccc rammstein ccc günaydın diler 30 04 2025
-
deprem olunca ev fiyatları niye yükseliyor
-
ölene kadar çalışcak mıyız şimdi
-
mentalcel yok mu olum
-
stripchat türkiye seçin
-
endonezya bali li sevgilime aldığım hediye
-
insta mia khalifa doldu
-
abdullahh uçmak ibrahim tatlıses yorumu
-
bir savaş falan olsa sallıyorum
-
züt desem ayıp ama züt
-
evlatlarla avratlar bir olursa
-
bu devirde haber spikeri olacaksınız
-
merve dizdar güzel mi değil mi
-
23 cm aletin olsun kardiş
-
olips tavsiye ederim
-
gene sidresli bi gün
-
zalina zurt zurnanın zart deliği
-
hayat artigi ne haber dostttt
-
siz niye büllük uzatıyonuz
-
yav bari yapragim buyuk olsaydi
-
lekolasirenaya da çakan vardır aramızda
-
ölüm olmasaydı onu icat etmek zorunda kalırdık
-
bugün işten erken çıkıyorum
-
kalça dediğin böyle olur lavaş şeftalisi
- / 2