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

Time:05-31

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.

CodePudding user response:

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.

CodePudding user response:

  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.

  • Related