The main() function in all C programs has a return value, but it can also sport two arguments, which relay details typed at the command prompt or specified in a GUI. To use the main() function's arguments you must know what they represent and what they reveal about any command-line options the program may require.
- No matter how graphical the operating system, … internally programs are launched and services started … by using a command line. … First comes the commands name; this is followed by a series … of options or switches, … (keyboard clicking) … the program processes this information as command line … input, it works as you see here because these command line … arguments are also the arguments to every … C program's main function. … This exercise file contains the code for the arguments … program run at the command prompt, the main functions … arguments are set at line three. … Specifying these options is optional if they're not used … in the code, but they're always available, … also you never specify a void between the parentheses, … if you're not going to use the arguments just leave … the parentheses blank as you've seen in other … C language programs where the main functions arguments … are not used. … These arguments are traditionally named argc, … which is an integer and comes first, this value represents …
- 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.