Friday, 21 February 2014

How to run a C or C++ program in Visual Studio IDE ?

21.2.14

Compiling and running a C program in Visual Studio is not a big and tedious stuff. Its after all a simple trick.
In this article, I have given the details to bend Visual Studio to do your job.



1. Select File > New > Project or press CTRL + shift + N.

2. In the dialog box which just appeared , in the left pane select Templates > Visual C++ .  In the Middle Pane, select "Win 32 console Application". In the bottom pane , enter the name for your project in the "Name" text box and click OK.

3. Next a wizard appears. In the first window just click Next and proceed. In the Second window, Select the 'Empty Project' check box under Additional Options and click Finish.

4. Now you would be seeing the working space and we are going to create the C or C++ file where you are going to type your program codes. You must be seeing the "Solution Explorer" pane either at the left or right side of the window. If it is not visible, make it visible by selecting View > Solution Explorer or press Ctrl + Alt + L.

5. In the solution explorer pane, expand your project folder and you must see four folders and the select the last folder named "Source Files" and Right click on it and select Add > New Item.

6. A new dialog box appears. Here select C++ File(.cpp). You can run both C and C++ programs using this file. Enter a name for your file at the bottom of the window and click "Add".

7. Type in your program here. Save the File. Press F5 to compile and check for errors. Select Debug > Start without Debugging to run the program. The program runs in the Command Prompt console.


Cheers !!
Like and Share this Article

Article by

I am a Computer Science Undergrad obsessed with Technology. Blogging is my hobby. I like to design websites.

0 comments:

Post a Comment

 

© 2013 VirtualVeins. All rights resevered. Designed by Templateism

Back To Top