top of page

Visual C ++


For another way to run C++ code, in addition to the one described in last night's tip, try installing Visual C++ Build Tools which are available here, https://msdn.microsoft.com/en-us/library/ms235639.aspx at the link named Microsoft Visual C++ Build Tools 2015. The instructions on this page will show you how to run C ++ code .cpp files in Windows command prompt. In this example we're going to run a C ++ code called sortstring.cpp which can be found in this online library. After the software is installed, you just need to follow these steps:

1. In the Programs menu go tothe Visual C++ Build Tools folder, the Windows Desktop Command Prompt Tools subfolder and select Visual C++ 2015 x86 Native Build Tools Command Prompt.

2. Go ahead and create a folder at the root of your C drive named 'hello' and save a .cpp file there.

3. Go back to the command prompt and type in

cd c:\hello

to change the directory to the folder containing your cpp file.

4. Now type in

cl /HEsc sortstring.cpp

5. This should generate an executable file in the source folder. Now at the command prompt type the name of the C++code file, without the extension, and press enter.

6. The program created by the code should run. In this example, the user is prompted to enter a total number of strings, followed by each string, and the code automatically sorts them in order.


 

Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

​

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

​

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page