Video description
Like a gruff uncle, C++ seems intimidating, when it’s just being helpful. These 75 examples will help you understand that. Let's parse that. C++ seems intimidating because all too often, what you see is not what you get. Usually, that's because C++ is trying to help you, but you don't realize that. This section is moving to C++ from C: If you are a C programmer, will run through what you need to know in order to move seamlessly to C++. Objects, Classes and Object-Oriented Programming: Access modifiers, classes, objects, the this pointer, new/delete and dynamic memory allocation gotchas. Operator overloading is a particularly complicated topic - C++ is virtually alone in the ubiquity of overloaded operators. Make sure this doesn't trip you up. Also go deep into the workings of const, static and friend. Inheritance in C++ is considerably more complicated than in Java, mostly because of multiple inheritances, and because of the co-existence of both virtual and non-virtual methods. Templates are a classic generic programming technique that was revolutionary when first added to C++. Understand template functions and classes, as well as template specializations. STL - the Standard Template Library - is incredibly powerful. Get a good sense of collections, iterators and algorithms - the major components of the STL. C++ casts are quite different than C-casts. Understand const_cast, static_cast and dynamic_cast, as well as Real Time Type Identification (RTTI), and the manner in which explicit conversions can be performed using static_cast. Exceptions and exception handling in C++.
What You Will Learn
- Harness the full power of C++ without being intimidated by the language s complexities
- Use inheritance, operator overloading, templates, STL and all major C++ language features
Audience
Java and C# programmers - who understand Object Oriented Programming, but are new to C++. Folks with prior programming experience in C. No prior object-oriented programming experience is needed.
About The Author
Janani Ravi: Janani Ravi is a certified Google Cloud Architect and Data Engineer. She has earned her master's degree in electrical engineering from Stanford. She is currently in Loonycorn, a technical video content studio, of which she is a cofounder. Prior to co-founding Loonycorn, she worked at various leading companies, such as Google and Microsoft, for several years as a software engineer.
Publisher resources
Table of contents
- Chapter 1 : Introducing C++
- Chapter 2 : Moving from C to C++
-
Chapter 3 : Objects and Classes
- Classes mean different things to different people!
- Classes - A logical grouping of data and functions
- Example 1 and 2: Define a really simple C++ class and instantiate it
- Example 3: Invoke the member functions of an object
- Example 4 and 5: Setup and clean up using constructors and destructors
- Example 6: Access Modifiers
- Chapter 4 : Multi-file Programs
-
Chapter 5 : Dynamic Memory Allocation: new and delete
- Dynamic Memory Allocation
- C++ memory allocation explained
- Stop using malloc and free
- Do not mix new/delete for single variables with array equivalents new[]/delete[]
- Example 8 and 9: Stop using malloc and free, use new and delete instead!
- Example 10 and 11: Use new[] and delete [] for arrays - never mix new and new[]
- Example 12: The Placement new operator and the "this" pointer
- Chapter 6 : The C++ string Class
- Chapter 7 : References
- Chapter 8 : The const Keyword
- Chapter 9 : The static Keyword
- Chapter 10 : The friend Keyword
-
Chapter 11 : Operator Overloading
- Understanding operator overloading - internal and external operators
- Choosing between internal and external implementations
- Example 44: Overloading the += operator
- Example 45: Overloading the + operator
- Example 46: Overloading the ++ (and --) operators
- Example 47: Overloading the assignment operator
- Operator Overloading - Streams Flashback
- Example 48: Overloading the and >> operators
-
Chapter 12 : Inheritance
- Understanding inheritance - Flashback to objects and classes
- Example 49 Understanding Inheritance
- Inheritance Explained – I
- Inheritance Explained – II
- Example 49: Access levels and inheritance types
- Example 49: Bringing all inheritance concepts together in code
- Examples 50, 51, 52: Types of inheritance
- Example 53: virtual functions
- Example 53 (continued)
- Example 54: pure virtual functions and abstract classes
- Example 55: Multiple Inheritances, and a Diamond Hierarchy
- Example 56: Virtual inheritance in a Diamond Hierarchy
- Example 57: Object Slicing
- Example 58: No virtual function calls in constructors or destructors!
- Example 59: Virtual destructors rock!
- Example 60: Why virtual functions should never have default parameters
- Example 61: The strange phenomenon of name hiding
- Example 62: Never redefine non-virtual base class methods
- Chapter 13 : Templates
- Chapter 14 : STL - The Standard Template Library
- Chapter 15 : C++ Casts
- Chapter 16 : Exceptions
Product information
- Title: Learn By Example: C++ Programming - 75 Solved Problems
- Author(s):
- Release date: January 2018
- Publisher(s): Packt Publishing
- ISBN: 9781789137774
You might also like
book
Programming: Principles and Practice Using C++, 2nd Edition
An Introduction to Programming by the Inventor of C++ Preparation for Programming in the Real World …
video
Practical C++: Learn C++ Basics Step by Step
This course offers a comprehensive approach to learning C++, a language often considered difficult to master …
book
The C++ Programming Language, 4th Edition
The new C++11 standard allows programmers to express ideas more clearly, simply, and directly, and to …
video
Multi-Paradigm Programming with Modern C++
C++ is a multi-paradigm language that lets you solve a problem in different ways, and this …