Sams Teach Yourself C++ in 24 Hours

Sams Teach Yourself C++ in 24 Hours

5.0 1
by Jesse Liberty
     
 

View All Available Formats & Editions

Starter Kit

Includes C++ compiler and IDE for Windows, Mac & Linux

 

In just 24 lessons of one hour or less, you can learn the basics of programming with C++–one of the most popular and powerful programming languages ever created.

 

Using a straightforward, step-by-step approach, this fast and friendly

Overview

Starter Kit

Includes C++ compiler and IDE for Windows, Mac & Linux

 

In just 24 lessons of one hour or less, you can learn the basics of programming with C++–one of the most popular and powerful programming languages ever created.

 

Using a straightforward, step-by-step approach, this fast and friendly tutorial teaches you everything you need to know, from installing and using a compiler, to debugging the programs you’ve created, to what’s coming in C++0x, the next version of C++.

 

Each lesson builds on what you’ve already learned, giving you a solid understanding of the basics of C++ programming concepts and techniques.

 

Step-by-step instructions carefully walk you through the most common C++ programming tasks

Quizzes and Exercises at the end of each chapter help you test yourself to make sure you’re ready to go on

Starter Kit software provides everything you need to create and compile C++ programs on any platform–Windows, Mac or Linux

 

Learn how to…

  • Install and use a C++ compiler for Windows, Mac OS X or Linux
  • Build object-oriented programs in C++
  • Master core C++ concepts such as functions, classes, arrays, and pointers
  • Add rich functionality with linked lists and templates
  • Debug your programs for flawless code
  • Learn exception and error-handling techniques
  • Discover what’s new in C++0x, the next version of C++

 

Jesse Liberty is the author of numerous books on software development, including best selling titles on C++ and .NET. He is the president of Liberty Associates, Inc. where he provides custom programming, consulting, and training.

 

Rogers Cadenhead is a web application developer who has written many books on Internet-related topics, including Teach Yourself Java in 24 Hours. He maintains this book’s official website at http://cplusplus.cadenhead.org.

 

CD-ROM Includes

C++ compiler

Visual development environment for Windows, Mac and Linux

Source code for the book’s examples

 

Register your book at informit.com/register for convenient access to updates and corrections as they become available.

 

 

 

Product Details

ISBN-13:
9780672331824
Publisher:
Pearson Education
Publication date:
04/11/2011
Series:
Sams Teach Yourself -- Hours
Sold by:
Barnes & Noble
Format:
NOOK Book
Pages:
528
Sales rank:
329,443
File size:
2 MB

Read an Excerpt

Hour 1: Getting Started

Welcome to Teach Yourself C++ in 24 Hours! In this very first hour you will learn:
  • How to set up and use the features of your compiler
  • The steps to develop a C++ program
  • How to enter, compile, and link your first working C++ program

Preparing to Program

C++, perhaps more than other languages, demands that the programmer design the program before writing it. Trivial problems, such as the ones discussed in the first few chapters of this book, don't require much design. Complex problems, however, such as the ones professional programmers are challenged with every day, do require design. The more thorough the design, the more likely it is that the program will solve the problems it is designed to solve, on time and on budget. A good design also makes for a program that is relatively bug free and easy to maintain. It has been estimated that fully 90 percent of the cost of software is the combined cost of debugging and maintenance. To the extent that good design can reduce those costs, it can have a significant impact on the bottom-line cost of the project.

The first question you need to ask when preparing to design any program is, "What is the problem I'm trying to solve?" Every program should have a clear, well-articulated goal; and you'll find that even the simplest programs in this book have one.

The second question every good programmer asks is, "Can this be accomplished without resorting to writing custom software?" Reusing an old program, using pen and paper, or buying software off the shelf are often better solutions to a problem than writing something new. The programmer who can offer these alternatives will never suffer from lack of work; finding less expensive solutions to today's problems will always generate new opportunities later.

Assuming you understand the problem and it requires writing a new program, you are ready to begin your design.

C++, ANSI C++, ISO C++, Windows, and Other Areas of Confusion

C++ is a language. DOS, Windows, UNIX, and MacOS are operating systems. When you learn C++, you'll want to learn it as a portable language without regard to which machine and operating system you'll run your programs on.

Teach Yourself C++ in 24 Hours makes no assumptions about your operating system. This book teaches ANSI/ISO C++. ANSI/ISO C++ is just another way of saying "standard" C++-the internationally agreedupon version that is portable to any platform and any development environment. The code presented throughout the book is standard ANSI/ISO and should run on almost any compiler. Therefore, you will see few references to windows, list boxes, graphics, and so forth. All that is operating system-dependent.

You'll see output accomplished through standard output. To make this work, you might need to tell your compiler to create a console application. This is the case with the Bloodshed Dev-C++ compiler. Some compilers, written to be used with Windows or the Mac or another windowing environment, call this a quick window, or a simple window, or perhaps a console window.

A compiler is the software you will be using throughout this book. It translates a program from humanreadable form into machine code, producing an object file that will later be linked and run. A linker is a program that builds an executable (runnable) file from the object code files produced by the compiler.

There are two compilers included on the CD-ROM with this book. The next section walks you through the set-up and installation process for the Dev-C++ Bloodshed compiler. It is designed to run in a windows-based operating environment and provides an integrated development environment (IDE) that permits you to edit, compile, debug, and more from a graphical interface. Eventually you might want to consider using another compiler that is not dependent on a Windows environment, but that is a matter of personal choice.

Installing and Setting Up the Compiler

To use the Dev-C++ Integrated Development Environment (IDE) supplied with this book, you need to use a Microsoft Windows operating system. If you are not going to be working in this environment, this section will not apply to you. You will need to find a compiler for your operating system. If you are working in Windows, then proceed with the installation of the Bloodshed C++ compiler, which is the graphical interface you will use for the remainder of the book. You might also see this graphical interface referred to as the Bloodshed Compiler, Bloodshed Dev-C++, Dev-C++, or Dev-C++ IDE. They are all the same.

Insert the CD and it should run automatically. If not, you can start it manually by running start.exe from the CD. Click Compiler Center, then click Launch Dev-C++ Installer. You will use the default settings, so click Yes, then Next, then you must wait until you get the Setup Complete window. When you see the Setup Complete window, click Finish. This brings you back to the original screen. Click Exit. You have now installed the Dev-C++ IDE, but need to configure it in order to make it easier to use. If you don't already have compression software installed on your computer, install the WinZip software from the CD-ROM. To start the installation process, you will follow similar steps to those outlined for the compiler installation.

Unzip the file from the CD, extracting it into the \Dev-C++ directory (or, if you did not use the default directory, the directory where you installed the compiler). Click Yes any time you get a Confirm File Overwrite window. This process will upgrade your Dev-C++ IDE from version 4.0 to version 4.01. After you complete the installation of the compiler and the upgrade, install the debugger. It is also located on the CD-ROM and can easily be installed by following the prompts. It is the Cygnus Insight debugger, version 5. The Dev-C++ compiler comes with a standard command line debugger. The Cygnus Insight debugger is graphical and easier to use....

Meet the Author

Jesse Liberty is the author of numerous books on software development, including best-selling titles on C++ and .NET. He is the president of Liberty Associates, Inc. (http://www.libertyassociates. com), where he provides custom programming, consulting, and training.

 

Rogers Cadenhead is a writer, computer programmer, and web developer who has written 23 books on Internet-related topics, including Sams Teach Yourself Java in 21 Days and Sams Teach Yourself Java in 24 Hours. He publishes the Drudge Retort and other websites that receive more than 22 million visits a year. This book’s official website is at http://cplusplus.cadenhead.org.

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >

Sams Teach Yourself C++ in 24 Hours 4.5 out of 5 based on 0 ratings. 2 reviews.
Anonymous More than 1 year ago
Anonymous More than 1 year ago