subject

Given the following struct definition: struct time
{
int hr ;
int min ;
int sec ;
}
, write a function,
struct time sec2hms( int secs )
which takes, as an argument, the number of seconds since midnight, and returns the time of day.
Copy the file readPeople. c. The main function should be in fine shape. You need to finish the function readPeople, and supply the freePeople function.
readPeople
Given a file handle and an array of null pointers:
Read the information (last name, first name, age ) for a single person
Store that information in a person instance allocated from the heap.
Append that instance to the array argument
Attempt to read another person
Here is a sample input file:
Smith
Granny
68
Tape
Scott
32
Wire
Barbara
45
You may assume:
Entries are complete. If there's a last name, then there's a first name and an age
Data is correct. Age will always convert to an integer.
freePeople
This function simply returns the heap instances pointed to by the array to the heap. Do not assume that the array is dense. Check every position for a non-NULL pointer.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, huntbuck14
Which of the following methods could be considered a “best practice” in terms of informing respondents how their answers to an on-line survey about personal information will be protected? respondents are informed that investigators will try to keep their participation confidential; however, confidentiality cannot be assured. respondents are informed that a research assistant will transfer all the research data to a password-protected computer that is not connected to the internet, via a usb flashdrive. the computer is located in a research team member’s office. the investigator uses the informed consent process to explain her institution’s method for guaranteeing absolute confidentiality of research data. the investigator uses the informed consent process to explain how respondent data will be transmitted from the website to his encrypted database without ever recording respondents’ ip addresses, but explains that on the internet confidentiality cannot be absolutely guaranteed.
Answers: 1
image
Computers and Technology, 22.06.2019 22:30, kierafisher05
What is the most popular genre of video games?
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, Zieken993
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, natasniebow
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
You know the right answer?
Given the following struct definition: struct time
{
int hr ;
int min ;
i...

Questions in other subjects: