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.
Reviewing code structure - C Tutorial
From the course: Complete Guide to C Programming Foundations
Reviewing code structure
- [Instructor] Computer code has a certain look. It ensures that your code is readable and understandable to other programmers. C code runs top down. The first line here is a comment. It's just a note to myself or another programmer. The comment is enclosed between slash asterisk and asterisk slash characters. The text between these characters is ignored, skipped over, as if it wasn't there. Next you see the include pre-processor directive. It tells the compiler to take in the standard IO header file, stdio.h, and insert its contents here. All C programs start with the main function. The function has a type int for integer. Its name is followed by parentheses in which arguments appear. None are used here. Functions contain statements which are enclosed in a set of curly brackets or braces. Braces are also used within a function to collect a block of statements. Here's a block between lines 11 and 15. These statements belong to the for loop statement at line 10. Braces block statements…
Contents
-
-
-
Coding your first program3m 40s
-
(Locked)
Challenge: Write your own code51s
-
(Locked)
Solution: Write your own code1m 50s
-
(Locked)
Getting into the C language2m 34s
-
(Locked)
Reviewing code structure3m 52s
-
(Locked)
Working the C development cycle3m 45s
-
(Locked)
Challenge: Find and fix the bugs43s
-
(Locked)
Solution: Find and fix the bugs1m 28s
-
(Locked)
Exploring the preprocessor3m 23s
-
(Locked)
Understanding header files and libraries3m 19s
-
(Locked)
Adding comments2m 49s
-
(Locked)
Chapter challenge: Building the foundation1m 11s
-
(Locked)
Chapter solution: Building the foundation1m 38s
-
-
-
-
-
-
-
-
-
-
-