Question: Can someone please help with this C programming question as soon as possible, I am getting errors with my code, I have given all information
Can someone please help with this C programming question as soon as possible, I am getting errors with my code, I have given all information for the question below. If my code is wrong, please help fix it
Question:


\fWrite a C program that sorts the environment variables passed to the program based on environment variable names. In the class, you Were shotvn with a program printing out all the environment variables passed to the program. Each environment variable has a variable name [the part before the '=' sign} and the a variable value (the part aer the '=' sign}. For example, the following three entries in envp {i.e., three environment variables}, the names are USER, FWD, and HOME, respectively, and the valuea are ubtrntu , ftmp, and {h omefubuntu. envnil = "USER=ubuntu" envp [6] = "Edna-"trap\" envp[7] = "HUME=IhomeIuhuntu" Your program needs to sort the environment variables. To get the environment variables, your program may use strtoko. The program can diremy sort the environment variables by exchanging the pointers saved in on V3]. You may also choose to create another data structure of you: choice {c.g.1 another array of pointers, or linked list}. But, no matter which method you choose, your program must print out the environment variables, including their names and values, in ascending order dEtEImined by applying .5 tramp {J on their name:;. For exarnple, the three entries above are sorted by calling stromp {' ,1 to compare USER, FWD, and HOPE. Since the strcmp I\") calls determine that "HOME"{ "FWD" and "Pwo"=:"USER". your program should print out HDME=Hhomefubuntu Pnn=ftmp USER=ubuntu
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
