iFarbod iFarbod - 1 year ago 132
C++ Question

How to set default header file extension in Visual Studio 2013?

Every time I create headers I must manually rename its extension from .h to .hpp.

And when I create C++ Projects with wizards, header files get created with the .h extension.

Is there any way to change C++ Headers' default file extension in Visual Studio 2013?

I know it doesn't affect performance, but I want to do this anyway.

Answer Source

The Visual Studio world uses ".h" extension, that's just the way it is and it makes no difference whatsoever the extension you use. They all become part of your ".cpp" files anyway when the are "included", they are literally copied in in-place of the "#include" line when the compiler runs. They can have any extension at all. It also doesn't matter if the source files are ".c" or ".cpp", the compile mode is set in the project properties, and will be C++ unless you deliberately change it, which would render most of the SDK unusable anyway.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download