Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Visual C++ 2008 Express Edition: Can I insert default code in every .cpp file I create?

If I have for example this code:

#include <iostream>
#include <cstdio>
#include <fstream>
#include <string>

When I create an empty project with Visual C++ 2008, how to insert this code in every .cpp file I create in this project?

like image 615
Gaith Avatar asked Jul 23 '26 09:07

Gaith


1 Answers

You can create an item template which would be a .cpp file with all the necessary includes. Then when you add a file to the project you would add that item instead of an empty .cpp file.

Item templates are located here:

%USER%\Documents\Visual Studio 2008\Templates\ItemTemplates

Guide on creating project and item templates.

like image 85
Konstantin Dinev Avatar answered Jul 27 '26 21:07

Konstantin Dinev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!