Page 1 of 1

C Assume the following: • A is a structure variable with members ma, mb, and mc. Members ma and mb are integers, member

Posted: Tue Jul 05, 2022 10:25 am
by answerhappygod
C
Assume the following:• A is a structure variable with members ma, mb, and mc. Members maand mb areintegers, member mc is a string.• B is a structure variable with the same data type as A.• C is a structure of variable with members mu, and mv. Member muis a single precisionfloating point, and member mv has the same data type as A.• L is a 1D array of 10 structures. Each array element has the samedata type as A.• M is a 2D array of structures. There are 4 rows and 5 columns.Each array element hasthe same data type as C.• pa is a structure pointer variable. Its value is the address ofA.• pb is a structure pointer variable. Its value is the address ofB.• pc is a structure pointer variable. Its value is the address ofC.
You need to demonstrate that you know how to access an elementor a member of agroup. For example, how do you access member ma of A? Or how do youget the string lengthof mc inside B?
Refer to the Table below. The 1st column shows the item number,the 2nd column shows thename of the variable to be used as entry point, the 3rd columnshows what element to accessor what to do with the element, the 4th column shows the operatorsthat you must use foraccessing the element. Finally, the 5th column shows the expression(answer). If the 4thcolumn is blank, it means that there is no restriction on whatoperator to use. Study the fiveexamples given in the first five rows (denoted by Ex. 1 to Ex. 5)to guide you in coming up withthe correct expressions/answers.
VERY IMPORTANT: Fill-up the last column. When you type youranswer, make sure that:
1. there is NO blank space in between characters; for example:do not type ( * pa ) . ma, itshould be (*pa).ma2. there are no unnecessary parentheses3. there is no semicolon
Your answers will be checked automatically by Canvas withpre-encoded minimalist answersusing a strict string comparison. Your answers will be consideredincorrect if you have spacesand/or unnecessary parentheses. Your answer will also be incorrectif you do not use the“must use operator(s)”.
QUESTIONS
C Assume The Following A Is A Structure Variable With Members Ma Mb And Mc Members Ma And Mb Are Integers Member 1
C Assume The Following A Is A Structure Variable With Members Ma Mb And Mc Members Ma And Mb Are Integers Member 1 (47.81 KiB) Viewed 15 times
Entry Variable A Entry Variable L Entry Variable C Entry Variable B Entry Variable M What to access or what to do get the string length of mc What to access or what to do get the string length of mc of the 8th array element What to access or what to do address of the 2nd character of mc What to access or what to do last character of mc (i.e., the character before the null byte) What to access or what to do get the string length of mc of the last array element "must use" operator(s) "must use" operator(s) [] "must use" operator(s) & and [] operators "must use" operator(s) [] "must use" operator(s) [] Expression (Answer) Expression (Answer) Expression (Answer) Expression (Answer) Expression (Answer)