From the course: C: Data Structures, Pointers, and File Systems
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Mixing multiple source code files - C Tutorial
From the course: C: Data Structures, Pointers, and File Systems
Mixing multiple source code files
- [Instructor] If you like, you can put all 6,000 lines of code into a single source code file. A better option, however, is to break up your code into several source code files or modules. To show you such a multi-part program would work, follow along in Code::Blocks. I'm going to start by creating a new console C language project and it has to be a project. Console Application, C language and I'm going to call this project horserace. Click Next and I don't need to debug configuration, so uncheck that box if it's checked. Click Finish. Now Code::Blocks automatically gives you a skeleton main.c function. We don't need this for this code, so I'm going to remove it in the project. Right click on the project title and we will Add files from the Exercise Files, all five of 'em here. Click Open and then Code::Blocks organizes those files by sources and headers. I'm going to go ahead and open up each one into its own tab. The main function is always where the program starts no matter how…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Solving math puzzles3m 32s
-
(Locked)
Creating random numbers3m 42s
-
(Locked)
Working with time functions3m 54s
-
(Locked)
Sorting data4m 8s
-
(Locked)
Debugging your code2m
-
(Locked)
Using a debugger4m 53s
-
(Locked)
Writing your own header file2m 53s
-
(Locked)
Mixing multiple source code files4m
-
(Locked)
Challenge: Lotto simulation1m 18s
-
(Locked)
Solution: Lotto simulation2m 29s
-
(Locked)
-