课程: Complete Guide to C Programming Foundations

今天就学习课程吧!

今天就开通帐号,24,100 门业界名师课程任您挑!

Chapter challenge: Manipulating a structure

Chapter challenge: Manipulating a structure - C教程

课程: Complete Guide to C Programming Foundations

Chapter challenge: Manipulating a structure

(bright upbeat music) - [Instructor] In the challenge exercise file, you see a structure, person, defined starting at line nine. It contains a string, name and an integer value ID. In the main function, person structure variable you is declared at line 17. Two functions are called in the main function, fill and output. You see their prototypes up top here at line six and seven, and the skeletons for the functions appear down here. Your task is to code these functions. Code the fill function. This function accepts no arguments. Its job is to fill both members of a person's structure, the name and the ID, prompt for both members, which is provided by user input, and the function returns the structure created. Also code the output function. The function's argument is a person structure, which is referenced as variable y within the function. Output the structure's members, the name, string and the integer ID. Use this format, ID nn belongs to person name. The function returns no values…

内容