Arguments passed to a function are specified in the function's declaration, each listed by data type and a name, which is used within the function. No limit exists on the number of arguments and they can be of different data types, but specifying and crafting the proper number of arguments is important.
- [Instructor] Arguments passed to a function … must be given a data type, … which is set in the function's argument list. … In this exercise file, … the repeat function expects an integer argument count. … Count is used within the function to set a loop. … You do not need to re-declare the variable passed … within the function. … The value of the variable passed … is set in the function call … here in the main function at lines 15, … and again, at line 17. … The function sends a chunk of text to output, … repeating it as many times as was specified in the argument. … The repeat function doesn't return a value, … so it's typed as a void function, … build and run to see the results. … And this is true line. … I know these two guys. … In this exercise file, … the function average consumes three floating point values … as its arguments. … These values are assigned, within the function, … to variables a, b, and c. … The average is then computed, … and the result avg variable, the value of that variable, …
- 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.