I'm relatively new to VS (only used it once before for a simple project) and all I want to do is create a new C file for my project. When I go to add file to the project I created, the only available language option I'm remotely familiar with is C++. I chose开发者_高级运维 that and tried saving the file as a regular C file, which VS let me do, but it saved it as a separate file outside of my project. Is there a way I can add this C file to my project? I've tried playing around with some of the options and I can't seem to find a way.
On Solution Explorer, Click on the Source Files folder. Press Shift + Alt + A
to add an existing item to the sources folder. Then just choose your .c
file.
Works for me.
Right click on the Source Files folder from Solution Explorer -> Add -> Existing Item ... and choose your file.
I don't have a copy of VS handy at the moment and cannot check, but I believe it should be possible to create a new .c source file. What you can do for sure is to create your .c file outside of VS and then drag it into the solution explorer. Always works.
精彩评论