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.

Solution: Write your own code

Solution: Write your own code

(quirky music) - [Instructor] I'm going to code my solution from scratch using this empty file. I hope you did the same. What's the first thing in the file? This line is a pre-processor directive. It helps the program understand and use the puts function later. Also, this line is traditionally first in most C-code files, and I'll explain the details in a later video. The program starts here, the main function. All functions are enclosed in braces, and in this editor, and hopefully in yours as well, the second brace is added automatically and the code is indented, which is traditional. It makes things more readable. The put statement outputs a text or string, "I am a C programmer"; The string is enclosed in double quotes. The return statement sends the value zero back to the operating system. It ends in a semicolon, as well. Run to test the results. And there's the string. Don't fret if you encountered an error. These are common, even I get them, and I've been coding C for a long time.…

Contents