Question: Q1) C preprocessor should create the following files: - myParameters.h - linux.h - windows.h - main.e Expected contents of these files are specified below: myParameters.h:
Q1) C preprocessor should create the following files: - myParameters.h - linux.h - windows.h - main.e Expected contents of these files are specified below: myParameters.h: Define two macros named WINDOWS and LINUX. Depending on whether values of these macros are one or zero, the output will change. linux. h : Define a macro called HOST which prints 'Linux' on the screen. windows.h: Define a macro called HOST which prints 'Windows' on the screen. main.c: Create a main function in which you carry out the following operations: - Implement a conditional macro structure. If WINDOWS is 1 , windows.h will be included. If LINUX is one, linux.h will be included. If both WINDOWS and LINUX are zero, print 'Undefined Host' on the screen. - Display the value of macro HOST. Depending on the values of macros (WINDOWS and LINUX) you are expected to observe the output for three different cases as below: Host is Linux (if LINUX is one and WINDOWS is zero) Host is Windows (if WINDOWS is one and LINUX is zero) Host is hostUndefined (if both WINDOWS and LINUX are zero) Generate an expanded version of your C code by using the - E flag in gec (gce - E main.c). There should be three different versions of the expanded code depending on the values of the macros described above. What are the differences between the original file and the expanded version? You should include your answer in a file named report.txt. Send your original C file, along with the screenshots of the differences in the expanded version
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
