MelMed
MelMed

Reputation: 1752

Creation of hpp file in Visual Studio

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

Answers (2)

doctorlove
doctorlove

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.

For exmaple

Upvotes: 6

LihO
LihO

Reputation: 42103

.h is a perfectly valid alternative for .hpp. It's just an extension for a header, it doesn't mean it's .

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

Related Questions