C++ For Dummies
eBook - ePub

C++ For Dummies

Stephen R. Davis

  1. English
  2. ePUB (disponibile sull'app)
  3. Disponibile su iOS e Android
eBook - ePub

C++ For Dummies

Stephen R. Davis

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

The best-selling C++ For Dummies book makes C++ easier!

C++ For Dummies, 7 th Edition is the best-selling C++ guide on the market, fully revised for the 2014 update. With over 60% new content, this updated guide reflects the new standards, and includes a new Big Data focus that highlights the use of C++ among popular Big Data software solutions. The book provides step-by-step instruction from the ground up, helping beginners become programmers and allowing intermediate programmers to sharpen their skills. The companion website provides all code mentioned in the text, an updated GNU_C++, the new C++ compiler, and other applications. By the end of the first chapter, you will have programmed your first C++ application!

As one of the most commonly used programming languages, C++ is a must-have skill for programmers who wish to remain versatile and marketable. C++ For Dummies, 7 th Edition provides clear, concise, expert instruction, which is organized for easy navigation and designed for hands-on learning. Whether you're new to programming, familiar with other languages, or just getting up to speed on the new libraries, features, and generics, this guide provides the information you need.

  • Provides you with an introduction to C++ programming
  • Helps you become a functional programmer
  • Features information on classes, inheritance, and optional features
  • Teaches you 10 ways to avoid adding bugs

The book incorporates the newest C++ features into the fundamental instruction, allowing beginners to learn the update as they learn the language. Staying current on the latest developments is a crucial part of being a programmer, and C++ For Dummies, 7 th Edition gets you started off on the right foot.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
C++ For Dummies è disponibile online in formato PDF/ePub?
Sì, puoi accedere a C++ For Dummies di Stephen R. Davis in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatique e Programmation en C. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2014
ISBN
9781118823835
Edizione
7
Argomento
Informatique
Part I

Getting Started with C++ Programming

9781118823774-pp0101.tif
webextras.eps
Visit www.dummies.com for great Dummies content online.
In this part…
  • Explaining the building blocks
  • Declaring variables
  • Defining mathematical operators
  • Using logical operators
  • Visit www.dummies.com for great Dummies content online.
Chapter 1

Writing Your First C++ Program

In This Chapter
arrow
Finding out about C++
arrow
Installing Code::Blocks on Windows, Ubuntu Linux, or Macintosh OS X
arrow
Creating your first C++ program
arrow
Executing your program
Okay, so here we are: No one here but just you and me. Nothing left to do but get started. Might as well lay out a few fundamental concepts.
A computer is an amazingly fast but incredibly stupid machine. A computer can do anything you tell it (within reason), but it does exactly what it’s told — nothing more and nothing less.
Perhaps unfortunately for us, computers don’t understand any reasonable human language — they don’t speak English either. Okay, I know what you’re going to say: “I’ve seen computers that could understand English.” What you really saw was a computer executing a program that could meaningfully understand English.
Computers understand a language variously known as computer language or machine language. It’s possible but extremely difficult for humans to speak machine language. Therefore, computers and humans have agreed to sort of meet in the middle, using intermediate languages such as C++. Humans can speak C++ (sort of), and C++ can be converted into machine language for the computer to understand.

Grasping C++ Concepts

A C++ program is a text file containing a sequence of C++ commands put together according to the laws of C++ grammar. This text file is known as the source file (probably because it’s the source of all frustration). A C++ source file normally carries the extension .CPP just as an Adobe Acrobat file ends in .PDF or an MS-DOS (remember that?) batch file ends in .BAT.
The point of programming in C++ is to write a sequence of commands that can be converted into a machine-language program that actually does what we want done. This conversion is called compiling and is the job of the compiler. The machine code that you wrote must be combined with some setup and teardown instructions and some standard library routines in a process known as linking. Together, compiling and linking are known as building. The resulting machine-executable files carry the extension .EXE in Windows. They don't carry any particular extension in Linux or Macintosh.
That sounds easy enough — so what’s the big deal? Keep going.
To write a program, you need two specialized computer programs. One (an editor) is what you use to write your code as you build your .CPP source file. The other (a compiler) converts your source file into a machine-executable file that carries out your real-world commands (open spreadsheet, make rude noises, deflect incoming asteroids, whatever).
Nowadays, tool developers generally combine compiler and editor into a single package — a development environment. After you finish entering the commands that make up your program, you need only click a button to build the executable file.
Fortunately, there are public-domain C++ environments. I use one of them in this book — the Code::Blocks environment. This editor will work with a lot of different compilers, but the version of Code::Blocks combined with the GNU gcc compiler used to write this book is available for download for Windows, Macintosh, and various versions of Linux, as described in the installation section of this chapter.
Although Code::Blocks is public domain, you’re encouraged to pay some small fee to support its further development. You don’t have to pay to use Code::Blocks, but you can contribute to the cause if you like. See the Code::Blocks website for details.
I have tested the programs in this book with Code::Blocks 13.12 which comes bundled with gcc version 4.7.1. This version of gcc implements most of the C++ 2011 standard.
c++11_fmt.eps
You can use different versions of gcc or even different compilers if you prefer, but they may not implement the complete '11 standard. For that reason, 2011 extensions are marked with the '11 icon seen here.
c++14_fmt.eps
The gcc compiler does not implement any of the extensions added in the C++ 2014 standard as of this writing, but I have included them, where applicable, because some day it will.
Okay, I admit it: This book is somewhat Windows-centric. I have tested all of the programs in the book on Windows 2000/XP/Vista/7/8, Ubuntu Linux, and Macintosh OS X. I flag any differences between operating systems in the text. In addition, I include installation instructions for each of the above three operating systems in this chapter. Versions of Code::Blocks and gcc are available for other flavors of Linux and other versions of the Macintosh OS. The programs should work with these, as well.
warning.eps
The Code::Blocks/gcc package generates 32-bit programs, but it does not easily support creating “windowed” programs. The programs in this book run from a command line prompt and write out to the command line. As boring as that may sound, I strongly recommend that you work through the examples in this book fir...

Indice dei contenuti