From the course: Complete Guide to C Programming Foundations
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Challenge: Constructing a structure - C Tutorial
From the course: Complete Guide to C Programming Foundations
Challenge: Constructing a structure
(light music) - [Instructor] For this challenge, your task is to write a program that contains a structure. The structure contains your birthday, your height in kilometers, and your name. Make your birthday a nested structure with three members, day, month, year. Your height in kilometers is a real number. And your name is a string. Declare the structure variable, and assign to that structure variable members, the data that describes yourself. You can choose to assign values directly when the structure variable is declared, or you can assign them later. Use a printf statement to output the structure values like this. George Washington was born on February 22nd, 1732, and he's this number kilometers tall. But make the data about yourself, not President Washington. A source code skeleton is provided in the exercise files to help get you started. This task should take about 10 minutes to complete.
Contents
-
-
-
-
-
-
-
-
Understanding arrays2m 48s
-
(Locked)
Working with arrays2m 51s
-
(Locked)
Challenge: Creating an array55s
-
(Locked)
Solution: Creating an array1m 41s
-
(Locked)
Passing an array to a function2m 45s
-
(Locked)
Working with multi-dimensional arrays2m 42s
-
(Locked)
Building a structure3m 31s
-
(Locked)
Nesting structures3m 17s
-
(Locked)
Challenge: Constructing a structure1m 3s
-
(Locked)
Solution: Constructing a structure3m 5s
-
(Locked)
Putting structures into an array2m 37s
-
(Locked)
Working with structures and functions3m 47s
-
(Locked)
Chapter challenge: Manipulating a structure1m 22s
-
(Locked)
Chapter solution: Manipulating a structure2m 4s
-
-
-
-
-
-