Reputation: 1752
When I'm about to add a new file to a project with Visual Studio and I want it to be .hpp
, only .h
files are available.
How to create .hpp
files?
Upvotes: 4
Views: 20846
Reputation: 19272
You can change the extension to whatever you want when you add a new file. Just change the name from "Header.h" or whatever default it gives you to your chosen name.
Upvotes: 6
Reputation: 42103
.h
is a perfectly valid alternative for .hpp
. It's just an extension for a header, it doesn't mean it's c.
Your compiler will treat this file the same way no matter whether the extension is .h
or .hpp
. Yet if for some reason you still need .hpp
extension, just click New Item ~> Header File (.h) and at the bottom name it with .hpp
extension.
Alternatively you might create .h
and just rename it directly within the solution explorer.
Upvotes: 1