This preview shows page 1. Sign up to view the full content.
Unformatted text preview: y, the ‘.h’ ﬁle deﬁning the compile-time constant CNT and the structure a_struct are in ﬁles for which you do not have access privileges. Fortunately, you have access to a ‘.o’ version of code, which you are able to disassemble with the objdump program, yielding the disassembly shown in Figure 3.38. Using your reverse engineering skills, deduce the following: A. The value of CNT. B. A complete declaration of structure a_struct. Assume that the only ﬁelds in this structure are idx and x. Homework Problem 3.37 [Category 1]: Write a function good_echo that reads a line from standard input and writes it to standard output. Your implementation should work for an input line of arbitrary length. You may use the library function fgets, but you must make sure your function works correctly even when the input line requires more space than you have allocated for your buffer. Your code should also check for error conditions and return when one is encounted. You should refer to the deﬁnitions of the standard I/O functions for documentation [30, 37]. Homework Problem 3.38 [Category 3]...
View Full Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
- Spring '10
- The American