CS 2110 Lecture Notes - Lecture 11: Code Segment, Null Character, Segmentation Fault

8 views2 pages

Document Summary

Answer: dereferencing c will give 1 byte of the integer x. Explanation: dereferencing c points to *px which is equal to &x which is used to find the address of x which is 13. You may assume student is properly initialized somewhere else in the code. Explanation: *student is a pointer reference that is equivalent to student , consider the following c code segment: char c[5]; Without using [] array notation, give a valid c expression for the char at index 1 in c. Answer: char c_1 = *(c + 1) Without using [] array notation, fill in the blank below to create a valid c expression the sets s_4 to the value of the short at s[4]. Answer: short s_4 = *(s + 4) Answer: a = 2, b = 3, c = 15. Answer: the segfault error is occuring at lines 5 and 6.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents