Table of Contents
Repeat in your virtual machine the steps shown in the video mentioned in the previous section.
A resource that is worth keeping it handy to check (not to read right now because it has 300 pages) is “The GNU C Programming Tutorial” written by Mark Burgess (Online version). It contains detail information about everything related to C.
After reading the suggested document, answer to the questions in the following section.
Remember that when the compiler processes source files, it does so independently and in a single pass. Consider the following source files.
file_1.c
|
file_2.c
|
file_3.c
|
||||||
---|---|---|---|---|---|---|---|---|
|
|
|
Answer the following questions.
Post in the course forum or check with the professors those questions that you are not sure about the answer.
Solve the first four exercises. Check the solutions with a classmate, posting in the course forum or going to office hours before the next class.
The following documents complement the information included in this chapter.
Sections 6.1, 6.2 and 19.6 of “The GNU C Programming tutorial”.
Solve the first three exercises. Check your results with a classmate, posting in the forum or during office hours.
The following documents complement the information included in this chapter.
Sections 4.1 to 4.4 of “The GNU C Programming tutorial”.
Solve the first three exercises. Check your answers with your a classmate, posting in the course forum or during office hours.
In an application to execute in a mobile phone, the following data structures need to be designed:
Structure to store a call rate. It must contain the name of the carrier company, the hour of start and end of the rate (both values between 0 and 23), the rate for establishing the call, and the minute rate (both in euros). Declare a synonym for this type. Declare a table to store 100 elements of this type.
Structure to store an outgoing call. It must contain the name of destination carrier, the starting hour (only the hour, between 0 and 23, no minutes nor seconds), the duration in minutes and the number called. Declare a synonym for this type. Declare a table to store 100 elements of this type.
Answer the following questions.
What is the size of these tables?
How did you decide the length of the field to store the carriers name?
Can you propose a more compact version of your data structures?
Which functions can you think that can be implemented with the information in these tables? (either processing them separately or both at the same time).
Let us suppose that each data structure with their
functions are in separated files. A third file is added in which only
the main
function is defined, but it uses all the functions
and the data structures previously defined. Which information must be
included before the main
definition?