From the course: Complete Guide to C Programming Foundations
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Challenge: Writing a function - C Tutorial
From the course: Complete Guide to C Programming Foundations
Challenge: Writing a function
(pensive music) - [Instructor] It is time for you to write a function. Use the source code provided in this exercise file to get you started. The source code lists calls to a function named line, which isn't defined anywhere in this code. Your job is to write the line function. The function's job is to generate a line of 40 hyphens. The line function is a void type, which you can tell in the exercise file because it accepts no arguments and returns no value. This challenge could take up to 10 minutes to complete, but I bet you do it a lot faster.
Contents
-
-
-
-
-
-
-
Understanding functions3m 11s
-
(Locked)
Creating a function4m 52s
-
(Locked)
Challenge: Writing a function39s
-
(Locked)
Solution: Writing a function1m 49s
-
(Locked)
Returning a value from a function2m 23s
-
(Locked)
Challenge: Returning a value53s
-
(Locked)
Solution: Returning a value2m
-
(Locked)
Passing arguments to a function2m 22s
-
(Locked)
Challenge: Passing values41s
-
(Locked)
Solution: Passing values1m 50s
-
(Locked)
Using the main() function's arguments2m 13s
-
(Locked)
Retaining values in a function2m 34s
-
(Locked)
Creating recursive functions3m 44s
-
(Locked)
Chapter challenge: Write the functions1m 14s
-
(Locked)
Chapter solution: Write the functions2m 15s
-
-
-
-
-
-
-