Question
Initialization: Output: Task: Task Write a C program that declares your particular data structure as described in the C structure description file. Statically initialise an
Initialization:
Output:
Task:
Task Write a C program that declares your particular data structure as described in the C structure description file. Statically initialise an instance of the data structure to the initial values as specified in the file use the data formats as specified in the file such as hexadecimal, decimal or octal constants. In the main program, print out the data structure using printf formatting to make it exactly match the provided sample output file. Note that you may need to use various formatting options with printf to control the appearance of the output. You are expected to read about printf and work out how to format the data so that it exactly matches the expected output. Submit your program for automatic assessment using the lab command. Your program style may be assessed according to the coding standards in the documents Some Important Comments on Code Style and Systems Programming Style which are available on iLearn.
Stage 1: Initialising a C struct and printing it out as text 3 marks] In this stage you will declare a C data structure, create an instance of it and statically initialise it Ideclare it as a static or gobal variable and initialise it in one statement using braces) You wil then print out the instance. This stage develops the following specic sklls: Declaring a Catzuct Initialising a Catruct Printing varicus data types using printf Note: Do not use bit fields in your struct. All the data types that are specified correspond to ordinary C data types. Note: The automarker checks your struct definition agairet expected ways of writing it and awards marks for correctness Field names must be exactly correct. Types should be the common C language data types as defined in ANSI C The tolowing documents on Learm may be helpful Comple, Run, Make C Progroms on Linu C Programming Notes for Doto Five Lao Your downloaded stagel.tar fle contains the following fles: files truct-description. Dlt: A simple description of the fields that are in your struct-their names and type description ini tlisation-specification. txt: Spectes the initial value for each tield of your struct. The inital value has to be tormatted in a specic way In your source code-this * . Decimol, Binary, tal and Hex. NoteIt makes no dference to the data that is stored inside the computerwhether you Initalsc the tiedwith decimal or the equlvalent headecimal or octal. However, 3s an exercie, we require you to make the zppropriate type converslons and the automarker wil check yur code cxpccted-output.ct:S1 expected output tile. Usc the examplc in this fic to work outwha:tormatting cptions to use npzinct. lisetul Unik ditt Task write C program, 'het declares your petitular data structure , described in the C structure description file Staticaly Initial an instanee ot the data structure to the initial values as specitics n the File-use the dete formats as specified in the file such as hesadetimel, decimal or octal constants. In the main program, print out the dets strucung printt formetting to make it exactly match the provided sample output file. Note that you may need to use various formattirg optioms withprintt to control the appearance of the output You are espected to read ebout printt and work out how to format the data so that it exectly matches the expected output Submit your program tor automatic assessment using the 1ab command. Your program style may be assessed according to the coding standerds in the documents Some important Comments on Code Style and Systems Programming Style which are available on iLearnStep 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