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 !!
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 !!