fetusfinn
fetusfinn

Reputation: 1

How do I create a source and header file at once on VS?

I've just recently changed from MacOS/Xcode to Windows/VS so I'm a little confused on how to do some things, but I was wondering how I could create a source file with a matching header at the same time instead of doing each file separately. XCode on Mac asks if you also want to create a header with the source file but I cant seem to see that anywhere on VS.

Am using Win11 and the latest version of VS.

Upvotes: 0

Views: 2701

Answers (2)

Minxin Yu - MSFT
Minxin Yu - MSFT

Reputation: 4237

  1. Properties:Add New Item->C++ Class

  2. Click OK.

Or

Create a .h file from function in cpp file:

  1. Click the function name to highlight it.

  2. ALT+SHIFT+F10-> Create Declaration/Definition

Maybe there are other plugins can do it.

Upvotes: 0

Öö Tiib
Öö Tiib

Reputation: 11014

I have done it by pressing Ctrl+Shift+X when C++ project is selected in solution explorer of Visual Studio. It should open a class wizard where you can add new or modify existing C++ classes.

Upvotes: 1

Related Questions