Grundkurs i C++, för C programmerare

C++ skapades som en förbättrad version av C, därav namnet. Vi visar i denna kurs att allt man kan göra i C kan man också göra i C++, men med betydligt mer underhållsvänlig kod och med högre kodkvalitet. Denna grundkurs riktar sig till rutinerade C programmerare, som på snabbast tänkbara sätt vill börja med programutveckling i C++. Vi använder konsekvent C som referensram och illustrerar likheter och pekar på skillnader. Självklart använder vi modern C++, vilket innebär C++17, ett modernt designperspektiv och frekvent användning av standardbiblioteket.

Grundkurs i C++, för C programmerare
4 dagar
Beginner
Rutinerade C programmerare
Kunna programmera i C
  • GNU C++ Compiler
  • Jetbrains CLion
  • Ubuntu Linux
Här ser du vilka kursdatum som är tillgängliga. Klicka på en av datumknapparna för att anmäla dig till ett kurstillfälle. På kursen pratar läraren svenska, medan vårt kursmaterial alltid är författat på engelska.

Du sitter bekvämt framför datorn och deltar i kursen via internet. Vi använder programvaran Zoom för alla våra fjärrkurser.

I priset ingår kursmaterial som PDF.

Pris: 20 000 kr + MOMS/VAT (25%)

Du sitter bekvämt i ett av våra klassrum, vilka finns centralt placerade i Stockholms innerstad (Östermalmstorg).

I priset ingår tryckt kursmaterial (och som PDF), samt kaffe/te med smörgås på förmiddagen och kaffe/te med bulle på eftermiddagen.

Pris: 25 000 kr + MOMS/VAT (25%)

Om ni är tre eller fler personer från samma företags, kan ni beställa en företagsanpassad kurs. Då håller vi kursen på ett datum som passar er. Antingen på plats i era lokaler eller som en fjärrkurs. Vi kan även mixa fjärr- och klassrumskurs, om några av er önskar delta på distans medan resten föredrar att ses på plats.

Företagsanpassad Kurs

Här är ett sammandrag av vad du får lära dig på kursen.

  • Programming in Modern C++
  • Use the standard library efficiently
  • Design your own data types
  • Understand and apply insights regarding memory management in C++
  • Use auto (automatic type inference) almost always
  • Use lambda expressions to improve and simplify your code
  • Use std::string object productively
  • Work with STL containers, iterators and algorithms
  • Work file I/O and within the file system
  • Understand how to use and implement template based functions and classes
  • Understand how to use operator overloading
  • Understand when to use derived classes and virtual functions

Background and Overview

  • From cfront, Classic C++ and into Modern C++
  • Design objectives
  • Some myths and facts of C++
  • Language evolution
  • The concept Modern C++
  • Syntax summary
  • Simple compilation
  • C++ reference

Similarities with C

  • Data types
  • Expressions
  • Statements
  • Function declarations and function calls

Differences to C

  • Namespaces
  • Function overloading
  • Function default parameters
  • Template functions
  • Type casts
  • Type aliases

References

  • What is reference and do it differ from pointers
  • Call-by reference
  • Return by-reference
  • Rvalue references
  • What is move semantics and why is it important

Lambda Expressions

  • Lambda syntax
  • Passing free variables by reference or value
  • Functions taking lambdas as parameters and/or returning lambdas

Text Strings and Regexes

  • Why using std::string instead of nativ strings
  • Overview of std::string and its functions/operators
  • What is SSO (Short String Optimization) and how it is used
  • Working with legacy strings
  • Character oriented functions
  • Multi-line string literals
  • What is a regex
  • The regex support in modern C++
  • Matching text data to patterns
  • Searching using patterns
  • Replacing text fragments using patterns
  • Using regex iterators
  • Typical use cases
  • Splitting and joining strings

I/O Streams and Files

  • ostream / ofstream / ostringStream
  • istream / ifstream / istringstream
  • Bi-directional I/O with fstream
  • Manipulators
  • The input idiom
  • Line-oriented input
  • Word-oriented input
  • Character-oriented input

Helper Types

  • Pair
  • Tuple
  • Date-times
  • Durations
  • Clocks
  • Date formatting
  • Random number generators

STL Container Types

  • Sequence containers and typical methods
  • vector / dequeue / array
  • list / forward_list
  • Associative containers
  • Tree vs. hash implementations
  • Unique vs. multi-key versions
  • set / unordered_set
  • map / unordered_map
  • Container adapters

STL Iterators and Intervals

  • What is an iterator
  • What is a range and how is it used
  • Iterator categories
  • I/O iterators
  • End-point adapter functions

STL Algorithms

  • What is a std::* algorithm
  • The STL architecture
  • How to pass the business logic into algorithm functions
  • Understanding *_n and *_if suffixes of functions
  • Using functions with predicates
  • Using back_inserter iterators
  • Transforming and aggregating
  • Sorting
  • Populating data into containers

Classes (User Defined Types)

  • What is a user-defined type
  • Specification vs. implementation
  • Member variables and functions
  • Object creation (instantitation)
  • Visibility
  • Constructors
  • Destructor
  • Inline member functions
  • Member overloading
  • The pointer this

Class Member Forms

  • Class variables and functions
  • Member references
  • Read-only variables
  • Const marked functions
  • Inner classes
  • Friend declarations

Constructors and Destructors

  • Initialization
  • Default constructor
  • Destructor
  • Copy constructor
  • Assignment operator
  • Pitfalls
  • Standardized class form
  • Enforcing compiler-generated members
  • Deleting compiler-generated members
  • Type conversion constructor
  • Type conversion operator
  • What is move semantics
  • Move constructor
  • Move assignment operator

Heap Allocated Objects

  • What is dynamic memory anyway
  • Using the new and delete operators
  • Pitfalls
  • The placement variant of new

Exceptions

  • What is an exception
  • Throwing exceptions
  • Catching exceptions
  • The merits of automatic destructions during throw
  • Exceptions in the standard library
  • Pitfalls

Templates

  • What is a template
  • Function templates
  • Class Templates
  • Member function templates
  • Template parameter forms
  • Type eqiuvalence
  • Template specialization
  • Pitfalls
  • Type traits
  • Using decltype()
  • Variadic templates

Operator Overloading

  • What is overloading operators
  • Syntax
  • Overloadable operators
  • Rule set
  • Overloading of arithmetic operators
  • Overloading of relational operators
  • Overloading of I/O operators
  • Overloading of ++/– operators
  • Overloading of the index operator
  • Overloading of the arrow operator
  • Overloading of the function-call operator

Inheritance and Virtual Functions

  • Syntax
  • Protected visibility
  • There is no such thing as package visibility in C++
  • Invocation of super-class members
  • References and pointers of root class type
  • Performing down-casts using dynamic_cast
  • Constructor initialization order
  • Base class visibility
  • Virtual member functions and why they are important
  • What is the key difference between virtual methods and non-virtual methods in C++
  • How do I make a class and/or method abstract in C++
  • Use of override and final specifiers
  • Multiple inheritance and why you need to be careful
  • Implementing interfaces in C++

The Pre-Processor

  • Include files
  • CPP constants
  • Pre-defined constants
  • Conditional compilation
  • Include guards
  • CPP macro functions
  • Stringification and name catenation
  • Assertions

Building C++ Applications

  • Compilation steps
  • What is an abstract syntax tree (AST)
  • The assembler
  • Inline assembly code
  • The linker
  • Name mangling of C++ names
  • Inspecting the linker symbol table
  • The loader
  • Tracing executions
  • Compiler flags for warnings
  • Compiler flags for optimizations
  • Compiler flags for debugging
  • Creating a static archive file
  • Creating a dynamic linked library

Build Tools and Open-Source Libraries

  • Make
  • GNU Autotools
  • Premake
  • CMake
  • Gradle
  • Doxygen
  • Google Test
  • Catch2
  • log4cxx
  • Boost

Standards and Guidelines

  • Tracking the standard
  • Tracking compilers and what they support
  • Online compilers
  • The big C++ conference (cppcon)
  • The C++ Core Guidelines
  • GSL - The Guidelines Support Library