Question
You will develop a program in C that demonstrates the use of the environ global variable, and the getenv(), exit(), and atexit() functions as described
You will develop a program in C that demonstrates the use of the environ global variable, and the getenv(), exit(), and atexit() functions as described in Chapter 2 of the Robbins slides. The program will use these functions to display information about the environment variables that are set in the operating system and also to display a specific message each time the program ends.
Exit Handler.The program shall contain an exit handler function that displays the message shown below (including the 26 asterisks) as the last output from the program no matter what entries are provided on the command line. (Be sure to register the exit handler function as the first executable statements in the main() function.)
* * * * * * * * * * * * * * * * * * * * * * * * * * Environment Variable Display Program (by First_name Last_name)
Command Line.The program shall only accept each of the options shown below as valid entries on the command line.
a.out a.out
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started