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

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