C++ For Dummies
eBook - ePub

C++ For Dummies

Stephen R. Davis

Compartir libro
  1. English
  2. ePUB (apto para móviles)
  3. Disponible en iOS y Android
eBook - ePub

C++ For Dummies

Stephen R. Davis

Detalles del libro
Vista previa del libro
Índice
Citas

Información del 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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es C++ For Dummies un PDF/ePUB en línea?
Sí, puedes acceder a C++ For Dummies de Stephen R. Davis en formato PDF o ePUB, así como a otros libros populares de Informatique y Programmation en C. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Editorial
For Dummies
Año
2014
ISBN
9781118823835
Edición
7
Categoría
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...

Índice