Computer Science > EXAM > Arizona State UniversityCSE 340CSE340_S14_Final_Solution. (All)
Arizona State University Computer Science and Engineering CSE 340 - Spring 2014 Final Exam. Solution NAME: The following should be signed when you hand in your paper. I give my word of honor and... solemnly swear that I did not violate the academic integrity policy in answering the questions of the exam Read everything carefully. Some statements can be tricky. Not all questions have equal weight. [ 5 points ] Consider the following C declarations: struct G; // declaration struct F { int y; struct D* next; }; struct E { int x; struct F next; }; struct D { int x; struct E next; }; struct H { int x; int (*next)(struct G); // pointer to a function that takes // struct G as parameter and returns int }; struct G { // definition float x; struct H next[10]; }; Assume that the size of a structure is the sum of the sizes of its fields and an int fields requires 6 bytes of space, a pointer field requires 4 bytes of space and a float field requires 8 bytes of space. Write your answer in the box: 1. sizeof(D) = 22 (int + struct E) 2. sizeof(E) = 16 (int + struct F) 3. sizeof(F) = 10 (int + pointer) 4. sizeof(G) = 8 (float) + 10*10 (array of struct H) = 108 5. sizeof(H) = 10 (int + pointer) 2 [15 points ] Consider the following function definition func f(a,b,c,d) = if c(c(a,b),b) then d[ [Show More]
Last updated: 2 years ago
Preview 1 out of 18 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Jun 12, 2022
Number of pages
18
Written in
This document has been written for:
Uploaded
Jun 12, 2022
Downloads
0
Views
121
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·