Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
C++ Application Development with Code::Blocks

You're reading from   C++ Application Development with Code::Blocks Using Code::Blocks it's possible for C++ developers to create application consistency across multiple platforms. This book takes you through the process from installation to implementing advanced features, all with a user-friendly approach.

Arrow left icon
Product type Paperback
Published in Oct 2013
Publisher
ISBN-13 9781783283415
Length 128 pages
Edition Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
BIPLAB MODAK BIPLAB MODAK
Author Profile Icon BIPLAB MODAK
BIPLAB MODAK
Arrow right icon
View More author details
Toc

First app debugging


Let us create a new console project App7 and replace code inside main.cpp file with following code:

#include <iostream>

int main() {
    const double pi = 3.1415926535897932384626433832795;
    double radius   = 20.0;
    double perimeter= 0.0;
    perimeter = 2 * pi * radius;
    std::cout << "Perimeter = " << perimeter << std::endl;
    return 0;
}

Ensure that Debug target is selected in compiler toolbar and then compile it by clicking compile button. App7 will be compiled for debugging.

Before we ask GDB to debug we have to create breakpoints for it. After the code is typed in editor window Code::Blocks will look similar to the following screenshot.

To set a breakpoint move cursor to the left side of editor window next to the indicated line numbers. Now the cursor will change to a right-tilted cursor. Pause mouse and left-click. A breakpoint will be set there and will be indicated by a red circle. The following screenshot shows that a breakpoint...

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