Add New C/C++ Header File
Add New C/C++ Header File
In this tutorial, we will learn how to add a new C/C++ Header File to a Project using Code::Blocks IDE. We can create a new C++ header file with the C/C++ header file wizard.
Code::Blocks is a free, open-source integrated development environment (IDE) primarily for C, C++, and Fortran. It offers a customizable interface, support for multiple compilers, and powerful debugging tools.
What is a header file?
A C++ header file contains declarations of functions, classes, and variables, allowing them to be shared across multiple source files. It typically has a .h or .hpp extension and is included in source files using the #include directive.
Add C/C++ Header File
Steps to Add C/C++ Header File to a project are as follows:
- Launch Code::Blocks IDE
- Click File >> New >> File…
- Choose C/C++ header under the Files section.
Click on the Go button.
Click on the Next > button in the C/C++ header file wizard.
Enter the filename and choose its path. The file extension should be .h or .hpp
Check the option Add file to active project. Select the build targets Debug and Release.
Click on the Finish button to add the header file.
That’s it. The new header file will be listed under the Headers section of the project.
Code::Blocks Tutorials
Code::Blocks Tutorials on this website can be found at: