Book Image

C++ Fundamentals

By : Antonio Mallia, Francesco Zoffoli
Book Image

C++ Fundamentals

By: Antonio Mallia, Francesco Zoffoli

Overview of this book

C++ Fundamentals begins by introducing you to the C++ compilation model and syntax. You will then study data types, variable declaration, scope, and control flow statements. With the help of this book, you'll be able to compile fully working C++ code and understand how variables, references, and pointers can be used to manipulate the state of the program. Next, you will explore functions and classes — the features that C++ offers to organize a program — and use them to solve more complex problems. You will also understand common pitfalls and modern best practices, especially the ones that diverge from the C++98 guidelines. As you advance through the chapters, you'll study the advantages of generic programming and write your own templates to make generic algorithms that work with any type. This C++ book will guide you in fully exploiting standard containers and algorithms, understanding how to pick the appropriate one for each problem. By the end of this book, you will not only be able to write efficient code but also be equipped to improve the readability, performance, and maintainability of your programs.
Table of Contents (9 chapters)
C++ Fundamentals
Preface

Preface

Note

About

This section briefly introduces the authors, the coverage of this book, the technical skills you'll need to get started, and the hardware and software requirements required to complete all of the included activities and exercises.

About the Book

C++ Fundamentals begins by introducing you to the C++ compilation model and syntax. You will then study data types, variable declaration, scope and control flow statements. With the help of this book, you'll be able to compile fully working C++ code and understand how variables, references, and pointers can be used to manipulate the state of the program. Next, you will explore functions and classes — the features that C++ offers to organize a program — and use them to solve more complex problems. You will also understand common pitfalls and modern best practices, especially the ones that diverge from the C++98 guidelines.

As you advance through the chapters, you'll study the advantages of generic programming and write your own templates to make generic algorithms that work with any type. This C++ book will guide you in fully exploiting standard containers and algorithms, understanding how to pick the appropriate one for each problem.

By the end of this book, you will not only be able to write efficient code, but also be equipped to improve the readability, performance, and maintainability of your programs.

About the Authors

Francesco Zoffoli is a professional software engineer currently working for Bloomberg LP in London.

He became enthusiast about modern C++ when joining the financial industry after a master degree in Computer Science and Engineering at Politecnico di Milano.

He is passionate about programming languages, maintainable software and large distributed systems.

He uses C++ for his personal projects as well as his day-to-day job to deliver scalable, efficient and resilient systems.

Antonio Mallia is a C++ enthusiast with half a decade of experience in the industry as a software engineer and is currently pursuing a PhD in computer science at NYU Tandon School of Engineering in New York City.

His research interest is mainly related to information retrieval, with a strong focus on improving the efficiency of large-scale systems. For this reason, C++ plays an important role in most of his projects and contributes to their success.

Objectives

  • C++ compilation model

  • Apply best practices for writing functions and classes

  • Write safe, generic, and efficient code with templates

  • Explore the containers that the C++ standard offers

  • Discover the new features introduced with C++11, C++14, and C++17

  • Get to grips with the core language features of C++

  • Solve complex problems using object-oriented programming in C++

Audience

If you're a developer looking to learn a new powerful language, or are familiar with C++ but want to update your knowledge with the modern paradigms of C++11, C++14, and C++17, this book is for you. To easily understand the concepts in the book, you must be familiar with the basics of programming.

Approach

C++ Fundamentals perfectly balances theory and exercises. Each module is designed to build on the previous module. The book contains multiple activities that use real-life business scenarios for you to practice and apply your new skills in a highly relevant context.

Minimum Hardware Requirements

For the optimal student experience, we recommend the following hardware configuration:

  • Processor: Intel Core i3 or equivalent

  • Memory: 4 GB RAM

  • Storage: 10 GB available space

Software Requirements

You'll also need the following software installed in advance:

  • OS: Any desktop Linux version or macOS, or Windows 7, 8.1, or 10

  • For Windows 10 systems: Windows subsystem for Linux (this is only available in the latest versions)

  • Browser: Use one of the latest browsers, such as Firefox, Chrome, Safari, Edge, or IE11

  • Modern C++ compiler

Additional Resources

The code bundle for this book is also hosted on GitHub at https://github.com/TrainingByPackt/Cpp-Fundamentals.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Create a file named HelloUniverse.cpp and save it."

A block of code is set as follows:

#include <iostream>
int main() {
  std::cout << "Hello Universe" << std::endl;
  return 0;
}

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Select System info from the Administration panel."