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

Mixing multiple source code files - C Tutorial

From the course: C: Data Structures, Pointers, and File Systems

Start my 1-month free trial

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…

Contents