Where Learning is Pleasure

Jayaram Krishnaswamy

Subscribe to Jayaram Krishnaswamy: eMailAlertsEmail Alerts
Get Jayaram Krishnaswamy: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Blog Feed Post

Creating your first C++ Console Application in Visual Studio 2017 Community

If you do not find the template for Console Application in Visual Studio 2017 Community's New Project window, read this here.

Launch VS 2017 Community and click New Project and expand the Visual C++ and Click Windows Desktop as shown. Provide a name, herein CplusDektop_1 and click OK. The program is saved to the default location (C:\Users\Owner\source\repos)


When you click OK, the program files/folder will be created as shown in the solution explorer.


There are two source files, CplusDesktop_1.cpp and stdafx.cpp. The CplusDekstop_1.cpp has the main() program as shown and is the entry point for the application:


The stdafx.cpp contains the pre-compiled type application and contains the header file stdafx.h. You may add other header file information if you need to, here.


You get intellisense support as shown and you should be looking forward to it as it increases productivity.

With the 'std' namespace added, the CPP file appears as shown.


Let us program  a 'Hello World" example.

You want to display 'Hello World' when the program is run. For getting input or putting out output you need to include the following:
#include <iostream>

With this added, your cpp file is as shown. 

Click Build solution from the main menu. You should see this:


Go to Debug menu as shown.

Click Start Without Debugging. The program runs and you see Hello World printed to the console as shown.

Read the original blog entry...

More Stories By Jayaram Krishnaswamy

Jayaram Krishnaswamy is a technical writer, mostly writing articles that are related to the web and databases. He is the author of SQL Server Integration Services published by Packt Publishers in the UK. His book, 'Learn SQL Server Reporting Services 2008' was also published by Packt Publishers Inc, Birmingham. 3. "Microsoft SQL Azure Enterprise Application Development" (Dec 2010) was published by Packt Publishing Inc. 4. "Microsoft Visual Studio LightSwitch Business Application Development [Paperback] "(2011) was published by Packt Publishing Inc. 5. "Learning SQL Server Reporting Services 2012 [Paperback]" (June 2013) was Published by Packt Publishing Inc. Visit his blogs at: http://hodentek.blogspot.com http://hodentekHelp.blogspot.com http://hodnetekMSSS.blogspot.com http://hodnetekMobile.blogspot.com He writes articles on several topics to many sites.