Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Visual Studio 2015 Cookbook

You're reading from   Visual Studio 2015 Cookbook Over 50 new and improved recipes to put Visual Studio 2015 to work in your crucial development projects

Arrow left icon
Product type Paperback
Published in Aug 2016
Publisher Packt
ISBN-13 9781785887260
Length 368 pages
Edition 2nd Edition
Arrow right icon
Author (1):
Arrow left icon
Jeff Martin Jeff Martin
Author Profile Icon Jeff Martin
Jeff Martin
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Exploring Visual Studio 2015 2. Getting Started with Universal Windows Platform Apps FREE CHAPTER 3. Web Development 4. .NET Framework Development 5. Debugging Your .NET Application 6. Asynchrony in .NET 7. Unwrapping C++ Development 8. Working with Team Foundation Server 2015 9. Languages 10. Final Polish Index

Analyzing your C++ code


Static analysis of C++ code is a feature offered in VS2015 Community and the Premium editions of Visual Studio. Static analysis is a useful way to locate potential problems in your code, and provides a way to catch a wide range of problems early in the development cycle.

In this recipe, we will show you how to use Visual Studio's built-in static analysis tools.

Getting ready

Start Visual Studio, and create a new project using the Empty Project template under Visual C++, giving it a name of your choice.

How to do it…

For this project, perform the following steps:

  1. Right-click on the project, and select Properties.

  2. Navigate to Configuration Properties | General, change Configuration Type to Static Library (.lib), and click on OK.

  3. Add a new Header File to the project, and name it AnalyzeThis.h.

  4. Enter the following code in the body of the header file:

    class AnalyzeThis {
      public:
      int LookHere(int param);
    };
  5. Add a new C++ File to the project, and name it AnalyzeThis.cpp.

  6. Enter...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image