Please answer the queston (in terms of C programming) and explain answer sn zss
ID: 3905563 • Letter: P
Question
Please answer the queston (in terms of C programming) and explain answer
sn zss or ahei ot Pipe of Semester 2 & Trimester 3B, 2015 COMP1004 Engineering Programming Q4(b) Define a C structure that will be used to represent the following data types () TIME structure having three members in the form of hour, minute and (i) IMAGE structure conmprising of the width (type integer) and height (type second, all of which are of integer type (3 marks). integer) of an image, an intensity 2-dimensional image (unsigned char) and a timestamp of the time (i.e. use the TIME structure above) at which the image is taken (3 marks). 6 marks)Explanation / Answer
i)
struct keyword is used to define the TIME structure and three attributes of struct hour, minute and second is defined as int.
2.
** represents pointer to 2 dimensional array as size is not known and can be instantiated and assigned with memory using malloc whenever struct is instantiated.