In this challenge, write a function that processes information based on arguments provided and returns the proper value. Knowing how to write a function, specify its data type, set arguments, and deal with return values, is an important part of learning to code in C. Writing a function to accomplish a specific task or remove redundancy helps make your code more efficient.
(upbeat music) … - [Instructor] It's time for you to write a function. … Use the source code provided … in exercise file 05_03-challenge1 to get you started. … This source code file lists calls to a function named line. … The function isn't defined in the code, … so your job is to write the line function. … The functions 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 generates no output. … This challenge can take up to 10 minutes to complete, … but I bet you do it a lot faster. … …
- Writing your first C program
- Working the C development cycle
- Adding comments to code for clarity
- C language data types
- Declaring variables
- Making new data types
- Typecasting variables
- Using math, assignment, and logical operators
- Creating for and while loops
- Nesting loops
- Creating functions
- Returning values from functions
- Passing arguments to functions
- Creating recursive functions
Skill Level Intermediate
C: Data Structures, Pointers, and File Systemswith Dan Gookin2h 57m Intermediate
1. The Fundamentals of C
2. Variables and Values
3. Operators and Math
4. Decisions and Loops
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.