Question: Compile and run the program in Figure 9.6. Explain its behavior. Create a new version that behaves more predictably. #include #include #include char* days [7]
Compile and run the program in Figure 9.6. Explain its behavior. Create a new version that behaves more predictably.
![#include #include #include char* days [7] = {](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1606/2/1/6/1165fbce9b41f4de1606216116293.jpg)
#include #include #include char* days [7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; char today [10]; void handler(int n) { printf (" %s ", today); int main () { signal (SIGTSTP, handler); for(int n = 0; ; n++) { strcpy (today, days [n%7]); // ^Z at keyboard
Step by Step Solution
3.36 Rating (168 Votes )
There are 3 Steps involved in it
In the main loop of the program we need t... View full answer
Get step-by-step solutions from verified subject matter experts
