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 - C Tutorial
From the course: Complete Guide to C Programming Foundations
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
-
-
-
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
-
-
-
-
-
-
-
-
-
-
-