I installed Visual Studio 2019 and I want to create a C project. Not C++ and not C# There is no option for a C solution But the doc says VS is both a C and a C++ compiler. I see no option for a C solution. There is a doc on the net explaining how to create C project in console from command line. But I want to create a "normal" project.
What should I do ?
I'll summarize what was explained in the video someone linked under your question, as I was able to reproduce the steps and create a working C project in Visual Studio. Kudos to the video creator and kiner_shah for sharing.
As a precondition, you shall be able to create C++ project in VS, so make sure you have the right extensions installed.
Create a new project (Shift+Ctrl+N), select Visual C++ and Console App. This will create a new console app with a default c++ main file. Remove that file and put in a main.c
file. This can be compiled, and works just fine.
You should be able to set up the environment by simply adding a ".c" extension to your code. Additionally, you can manually change your environment by opening your file in VS, clicking on the language displayed at the bottom (which should display "Select Language Mode" and choose C.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With