From the course: Secure Coding in C

Compiling the code - C Tutorial

From the course: Secure Coding in C

Start my 1-month free trial

Compiling the code

- [Instructor] Exercise files in this course can be compiled using any standard C compiler. In the movies, the files are compiled on a Windows 10 system using the Code::Blocks IDE shown here. The files are small, so you can import them directly into Code::Blocks, build and run, without creating a project. All code can be compiled in Unix, such as this Ubuntu Bash shell, available as an option for Windows 10 from the Microsoft Store. To compile on a command line, you type the name of the compiler, such as Clang, followed by the name of the source code file name. To run the code, type the default output file name prefixed by ./ and it works. This technique can be used in Unix, Linux, or the terminal window on a Macintosh. Speaking of the Mac, using Xcode works similarly to Code::Blocks, though to build a program in Xcode you must start a new C language command line tool project. Copy the exercise files source code into the Xcode window to build and run. Many times you don't need to compile the code as the exercise files are used only for demonstration. Still, all the code in this course compiles and runs, though be aware, some of the example files are deliberately written to be unsafe and have other issues. Such files are called out in the movies.

Contents