From the course: Complete Guide to C Programming Foundations

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Chapter solution: Building the foundation

Chapter solution: Building the foundation - C Tutorial

From the course: Complete Guide to C Programming Foundations

Chapter solution: Building the foundation

(bright music) - [Instructor] Here's how I converted this text file into a C source code file, a program though at this point, a program really doesn't do much. First include the standard IO and standard lib header files. These header files aren't needed in the final program, but they will be eventually, and they're considered part of the basic C language source code skeleton. So the first line of text to convert introduces the main function. I'm going to make it a comment. I like the traditional C comment style shown here, though you could easily write these using the newer slash slash style of comments. Now for the main function and convert the rest of the sentences into comments. The main function needs a return statement and a closing brace, and that's it. This program does run, but as you can see here, it has no output. I start all my big projects the same way, and someday you will as well. Remember, comments can be notes to your future self. Always write them down even when you…

Contents