Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

c program the catches the ctrl-c(SIGINT) Signal for the
first time and prints a output rather and exit on pressing
Ctrl-C again

Answer Posted / rakesh

#include <stdio.h>

#include <signal.h>



void sigproc(void);


main()

{


signal(SIGINT, sigproc);


printf("This program catches ctrl-c(SIGINT) signal for
first time and exit on pressing ctrl-c again\n");

for(;;);
/* infinite loop */

}

void sigproc()

{

signal(SIGINT, sigproc);

printf("you have pressed ctrl-c \n");

(void) signal(SIGINT,SIG_DFL);


}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is shell script a programming language?

1030


Is shell and terminal the same?

1062


How to set an array in linux?

1223


What is the use of echo in shell script?

1011


What is the command to find out today's date?

1141


What is a batch file used for?

1080


how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com

2568


Explain about non-login shell files?

1211


Explain about return code?

1071


What is scripting used for?

1043


Is powershell a language?

1048


What is c in shell script?

1068


What is the syntax of "nested if statement" in shell scripting?

1097


how will you find the total disk space used by a specific user?

1051


How do I run a bin bash script?

1032