1,105,286 Community Members

Compiling C in Visual Studio.NET

Member Avatar
HelloWorld23
Newbie Poster
2 posts since Dec 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-2
 

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

:)

Member Avatar
Narue
Bad Cop
12,139 posts since Sep 2004
Reputation Points: 5,693 [?]
Q&As Helped to Solve: 1,537 [?]
Skill Endorsements: 80 [?]
Team Colleague
 
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.

Member Avatar
HelloWorld23
Newbie Poster
2 posts since Dec 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Narue--

Thank you very very much for answering my post!

:)

Member Avatar
chayy_anne
Newbie Poster
1 post since Sep 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
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.

Question Answered as of 6 Years Ago by Narue and chayy_anne
Member Avatar
Narue
Bad Cop
12,139 posts since Sep 2004
Reputation Points: 5,693 [?]
Q&As Helped to Solve: 1,537 [?]
Skill Endorsements: 80 [?]
Team Colleague
 
0
 

>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 "<your project name> 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.

Member Avatar
beschi
Newbie Poster
4 posts since Nov 2008
Reputation Points: -7 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

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 select Solution 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

Member Avatar
shani443gb
Newbie Poster
1 post since Nov 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World21"<<endl;
return 0;
}

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article