The instructor presents his solution to the challenge, offering the final version of the course challenge. Alternative solutions are discussed, with reasons why they would work or fail.
(upbeat music) … - [Narrator] Here you see my two functions … which I pulled out of the main function … from last chapter's solution for this chapter's solution. … First comes the newline function. … It has a single statement putchar, … which outputs the newline character. … That's it, this function is … a void type and has no arguments. … It's called from the separator row function here at line 17, … and it's also called from the main function, … way down here at line 47. … The separator row function was the second requirement, … it uses two arguments, integer W and character C. … Its core is similar to one of the nested loops … found in the original main function. … In the main function, … separator row is called at line 40. … Creating these functions is more … of an exercise than a requirement … as this codes output is unchanged, … and I don't believe the code runs any more efficiently … than it did before. … Still, it's good practice to learn to pull statements … from one function and make a new function, …
- 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.