954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Compiling C in Visual Studio.NET

Hello --

1. Can you compile C code in Visual Studio.NET ?
If so, can you please submit the proper steps in order to do this.

Thank You

:)

HelloWorld23
Newbie Poster
2 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

Yes, you can. Go to Project and Properties, then somewhere in the myriad of options you'll see "Compile as C++" where you can change it to "Compile as C". And while you're at it, change the source file extension to .c instead of .cpp.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

Narue--

Thank you very very much for answering my post!

:)

HelloWorld23
Newbie Poster
2 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

Where do I find the Project and Properties tab/menu? I used to wrote C in Unix before, but now I don't have access to Unix computer anymore. Do we do the compiling using the "Start Debugging" menu? Tq.

Yes, you can. Go to Project and Properties, then somewhere in the myriad of options you'll see "Compile as C++" where you can change it to "Compile as C". And while you're at it, change the source file extension to .c instead of .cpp.
chayy_anne
Newbie Poster
1 post since Sep 2007
Reputation Points: 10
Solved Threads: 1
 

>Where do I find the Project and Properties tab/menu?
On the main menu is a menu item called "Project". Under that is another menu item called " Properties".

>Do we do the compiling using the "Start Debugging" menu?
I don't waste my time with the menus. I use Ctrl+F7 to compile, Ctrl+F5 to run in the debugger, and F5 to run outside of the debugger.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
Where do I find the Project and Properties tab/menu? I used to wrote C in Unix before, but now I don't have access to Unix computer anymore. Do we do the compiling using the "Start Debugging" menu? Tq.

Go to View Menu selectSolution Explorer or CTRL+ ALT +L

Then Select The project that your are developing and right click on that.

Then select the Properties from the submenu.

Then select the Configuration properties from the Tree structure. under that select C/C++ then select Advanced. Now in the right side pane change the property
Compile As from Compile as C++ Code (/TP) to Compile as C Code (/TC)

Finally change your file extensions to .c

Now you configured you Visual Studio to compile C programs

beschi
Newbie Poster
4 posts since Nov 2008
Reputation Points: 39
Solved Threads: 0
 

#include
using namespace std;
int main()
{
cout<<"Hello World21"<

shani443gb
Newbie Poster
1 post since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You