C++
Theory
- I. Fundamentals of C++
- 1. C++. Features
- 2. C++. General concepts
- 2.1. Base types in C++
- 2.2. Identifiers, reserved words, literals, escape sequences
- 2.3. The concept of variable. Declaration of variable. Operation expansion of scope :: . Memory allocation for variables. Constants
- 2.4. The concept of expression. Assignment operation. Converting and casting of types. Initialization. Unified initialization
- 2.5. The constexpr specifier. Differences between constexpr specifier and const. Example
- 3. Operations. Basic operators
- 3.1. Arithmetic operations
- 3.2. Operations of relations
- 3.3. Logical operations. Bitwise logical operations. Shift operations
- 3.4. Operators of increment (++) and decrement (––). The complex assignment operators
- 3.5. The operation sizeof. The ternary operation ? :
- 3.6. The operation priority table in C++
- 4. Control operators
- 5. Arrays. Strings
- 6. Classes for working with strings
- 7. Pointers. References
- 7.6. Composite managed and native data types. Managed pointers (^) in CLR. Memory allocation. The ref and value qualifiers. Managed pointers to structures and classes
- 7.7. References. Basic concepts. References to variables, structures, unions and class objects. Differences between references and pointers. Examples
- 8. Functions. Recursion
- 8.2. Functions and arrays. Passing a one-dimensional and multidimensional array to a function. Passing a structure and a class to a function
- 8.3. Default arguments in functions
- 8.4. Overloaded functions. Overloaded functions in classes. Overloading of class constructors. Access to the overloaded function using a pointer. Examples
- 8.5. Passing a constant parameters to a function. The return of constant from function
- 8.6. Generalization in functions. Template function. Keywords template, typename, class. Explicit specialization of template function. Overloading of template function
- 8.7. Recursion. Examples of tasks solving. Advantages and disadvantages of recursion
- 9. Structures. Unions. Enumerations
- 9.3. Working with managed-structures in CLR. Qualifiers ref and value. Declaring structural variables. Arrays of managed-structured variables. Initializing of managed-structures
- 9.4. Structures and functions. Passing a structure to a function in the CLR. Returning a structure from a function
- 9.5. Structures. Using methods in structures. Constructors in structures
- 9.6. Structures and inheritance. Structures and polymorphism. Abstract structure. Overloading of operators in structures. Static methods in structures
- 9.7. Unions. The keyword ‘union’. Examples of declaring and using unions
- 9.8. Enumerations. Keyword enum. The advantages of using enumerations. Examples
- 9.9. Bit fields in structures. Examples
- 10. Dynamic and static allocation of memory
- 10.1. Dynamic and static allocation of memory. Advantages and disadvantages. Allocating memory for single variables by the operators new and delete. Initialization when allocating memory
- 10.2. Memory allocation for structural variables, class objects, arrays. Initialization of allocated memory. Reallocation of memory. Examples
- 11. Preprocessor
- 11.1. Preprocessor. General information. Preprocessor directives. Review. Directives #define, #error, #include, #undef, #import, #using, #pragma, #line
- 11.2. Macros. Directive #define. Examples
- 11.3. Conditional compilation. Directives #if, #else, #elif, #endif, #ifdef, #ifndef. The defined operator
- II. Object-oriented programming in C++
- 2. Classes
- 2.1. The concept of class. Class declaration. The object of the class. Classes in the CLR. Data encapsulation in the class
- 2.2. Special functions in classes
- 2.2.1. Class constructor. Features of use constructors in the classes. The default constructor. Parameterized constructor. Examples of calsses that contain constructors
- 2.2.2. Copy constructor. Examples of using. Passing a class object to a function. Returning a class object from a function
- 2.2.3. Destructor. Definition of the destructor. Public and private destructors. Examples of destructors using. Differences between constructors and destructors
- 2.2.4. The default methods. Deleted methods. Keywords default, delete
- 2.2.5. Move constructor. Move operator
- 2.3. Members of the class data
- 2.3.1. Using the class data members. Static data members in the class. Static data members for native-classes and managed-classes
- 2.3.2. Class objects as members of the class data. Initialization of the internal object of the class. Examples
- 2.3.3. References to the class object. Access to a class object by reference. References as members of class data. Examples
- 2.4. Functions-members of class
- 2.4.1. Types of functions of class members. Ordinary member functions. Static member functions. Examples
- 2.4.2. Constant member functions. Member functions ‘volatile’
- 2.4.3. Class functions that are declared with a constant (const) ‘this’ pointer and a volatile ‘this’ pointer
- 2.4.4. Inline member functions of class. The inline keyword
- 2.5. Encapsulation
- 2.6. Classes of memory that can be declared when working with classes and class objects. Keywords register, extern, static, mutable
- 2.7. Managed and unmanaged classes in Visual C++. Overview. Example of implementing managed and unmanaged classes
- 2.8. “Friends” of the class. “Friendly” classes and functions. The keyword ‘friend’. Examples
- 2.9. Class templates
- 2.10. Arrays in classes
- 2.10.1. Arrays of objects in managed and unmanaged classes. Examples. Array of unmanaged pointers to a class
- 2.10.2. Initializing arrays with data values from class objects. Examples
- 2.10.3. Arrays of pointers to the class members methods. Examples
- 2.10.4. A pointer to a static member of a class data. Arrays of static data members. Arrays of pointers to a static data members of class. Examples
- 2.11. The concept of bitwise copying. Example
- 4. Operator overloading
- 4.1. Operator overloading in C++. Operator function. Keyword operator. Overload of basic arithmetic operators +, –, *, /. Examples of the implementation of built-in operator functions
- 4.2. “Friendly” operator functions: differences, implementation. Overload of operators +, –, *, / with the help of friendly operator functions
- 4.3. An example of elementwise summation of two arrays. Class DoubleArray. Overloading + operator. Dynamic memory allocation in class. Copy constructor. Bitwise copy disadvantages
- 4.4. Overloading increment and decrement operators ++, – –. Examples
- 4.5. Overloading of shortened assignment operators +=, -=, *=, /=, %=. Examples
- 4.6. Overloading operators new and delete. Examples
- 4.7. Overloading the assignment operator =. Examples
- 4.8. Overloading operator [ ] indexing items of the array
- 4.9. Overloading of operator ( ) of function call. Examples
- 4.10. Overloading of operators -> and ‘ , ‘ (comma). Examples
- 5. Aggregation, composition, inheritance, polymorphism, abstract classes
- 5.1. Types of relations between classes: is-a, has-a, uses. Examples. Aggregation. Composition
- 5.2. Inheritance
- 5.2.1. Inheritance. General concepts. Using private, protected, public modifiers when inheriting
- 5.2.2. Order of calling constructors during inheritance. Inheritance restrictions. Properties to the pointer to the base class
- 5.2.3. Multiple inheritance. Duplicate class and its data. Rhombus problem
- 5.2.4. Inheritance of template classes. Adding a new type in inherited classes
- 5.3. Polymorphism. Virtual functions. General concepts. Specifiers virtual, override. Examples
- 5.4. Abstract class. Pure virtual function. The abstract keyword. Examples
- 5.5. Restrictions on virtual functions. The final specifier
- 6. Exceptions
- 7. Namespaces. Keywords namespace, using. Namespace creation rules. Global namespace
- 9. Run-Time Type Identification. Smart pointers
- 10. File system
- 10.1. C++ File System. General concepts. Examples. Open/close file
- 10.2. Examples of using C++ for working with files
- 10.3. Examples of working with text files. Modification of files. Sort data in files. Converting file lines to array. Replacing/deleting lines in a file. Inserting a line in the file
- 10.4. Examples of saving/reading class objects. Serialization
- 11. Dynamic data structures
- 11.1. Stack. Operations on the stack. An example implementation of the stack as a dynamic array
- 11.2. Queue. General concepts. Ways to implement the queue. Implementing a queue as a dynamic array
- 11.3. Priority Queue. Example of implementation for template class. Implementation as a dynamic array
- 11.4. Ring queue. Developing a template class that implements a ring queue
- 11.5. Development a template class that implements a stack in the form of a linked list
- 11.6. Linear singly linked list. General information. Basic operations on the list
- 11.7. An example of implementation of a linear singly-linked list for the generic type T
- 11.8. Linear doubly linked list. General concepts. Basic operations on the list
- 11.9. Linear doubly linked list. Example of a template class
- 11.10. Implementation of the stack as a singly linked list
- 11.11. Binary search tree
- 2. Classes
- III. Library of standard functions and classes
- IV. Examples of classes development
- 01. Developing a class that implements an array of char* strings
- 02. Developing a Random class for generating random numbers
- 03. Development of a class that implements linear search in a one-dimensional array
- 04. Development of a class that implements the selection sorting algorithm
- 05. Development of a class that implements a “smart” pointer
- V. Standard Template Library (STL)
- 1. Standard Template Library. General concepts. Containers. Algorithms. Iterators. Functors
- 2. Containers
- 2.1. Class vector. Dynamic array
- 2.1.1. General information about the class vector. Methods overview. Creating a dynamic array. Ways to access vector elements
- 2.1.2. Methods that define and modify the general characteristics of array: size(), max_size(), capacity(), empty(), shrink_to_fit(), resize(), reserve()
- 2.1.3. Methods that modify data in the array. Methods push_back(), pop_back(), clear(), swap(), operator=(), erase(), insert(), assign()
- 2.1.4. Methods that provide access to array elements. Methods at(), front(), back(), data(), begin(), end(), cbegin(), cend(), rbegin(), rend(), crbegin(), crend()
- 2.2. Class map. Associate container
- 2.2.1. Creating a container. Constructors. Creating pair. Overview of class functions and operators
- 2.2.2. Methods that provide information from the container: at(), begin(), end(), count(), empty(), find(), size(), max_size(), operator[]()
- 2.2.3. Methods that change data in the container: clear(), erase(), insert(), swap(), operator=()
- 2.1. Class vector. Dynamic array
- 3. Algorithms
- 3.1. Algorithms for working with data which are presented according to the heap principle. Algorithms make_heap, push_heap, pop_heap, sort_heap
- 3.2. Algorithms for determining the minimum and maximum. Algorithms min, min_element, max, max_element, lexicographical_compare
- 3.3. Permutation algorithms. Algorithms next_permutation, prev_permutation
- 3.4. Non-modifying algorithms. Search. Examples. Algorithms find, find_if, find_first_of, find_end, adjanced_find, search, search_n
- 3.5. Non-modifying algorithms. Algorithms count, count_if, equal, equal_range, mismatch
- 3.6. Algorithms for working with sets. Algorithms includes, set_union, set_intersection, set_difference, set_symmetric_difference
- 3.7. Modifying algorithms. Part 1. Algorithms that change all elements of a sequence. Algorithms for_each, transform, fill, fill_n, generate, generate_n
- 3.8. Modifying algorithms. Part 2. Algorithms for exchanging values of sequence elements. Algorithms swap, swap_ranges, iter_swap
- 3.9. Modifying algorithms. Part 3. Algorithms that replace elements of a sequence. Algorithms replace, replace_if, replace_copy_if, replace_copy
- 3.10. Modifying algorithms. Part 4. Algorithms that extract individual elements or groups of elements from a sequence: remove, remove_if, remove_copy, remove_copy_if, unique, unique_copy
- 3.11. Modifying algorithms. Part 5. Algorithms processing the sequence as a whole without changing the values of the elements: copy, copy_backward, reverse, reverse_copy, rotate, rotate_copy, random_shuffle
Practice
1. Borland C++ Builder 2007.
- 001 – Creating a Windows application in C++ Builder.
- 002 – How to sort data in the database table.
- 003 – Generating report of RaveReport type based on Microsoft Access table in Borland C++ Builder.
- 004 – Connecting the database to the Windows-based application.
- 005 – An example of displaying the table of database in component TDBGrid – C++ Builder.
- 006 – An example of event programming in C++ Builder.
- 007 – An example of application development of calculating of cylinder volume in C++ Builder.
- 008 – C++ Builder. An example of creating and calling a new form from main form of application.
- 011 – C++ Builder. Developing the application of solution of the system of linear algebraic equations by Gauss.
- 012 – Development of program of graphics drawing functions of one variable. The function is defined by the formula.
2. Microsoft Visual Studio 2010-2019
- 001 – Creating a simple dialog application Windows of type Dialog Based Application by using MFC library.
- 002 – An example of creation of dialog window in MS Visual Studio 2010 – C++ (MFC Application).
- 003 – Creating an application of Windows Forms Application type in MS Visual Studio – C++. Review of main files of project.
- 004 – An example of developing the simply application of Windows Forms type in C++ by using MS Visual Studio.
- 005 – Example of application development of mathematical expressions with interception of possible exceptions. Using the “try…throw…catch” instruction
- 006 – Development of the program for problem solving use the operator conditional jump if. Overview the main properties of the form
- 007 – Development the program where to solve the problem is used “switch” statement
- 008 – Demonstration of use “for” loop in program. Example of calculating the sum of series
- 009 – Development of a program for calculating the sum of negative elements of array. Demonstration of using methods and properties of DataGridView control
- 010 – Development of a program for calculating an expression implemented by a single function. The PictureBox control
- 011 – Example of Unit-test creating in Microsoft Visual Studio – C++
- 012 – Solution of the problem of placing N queens on a chessboard
- 013 – Test. An application of type Console Application. Template class CArray
Solving of tasks
- One-dimensional arrays. Loops for, while, do…while
- One-dimensional arrays. Combining the loops operators for, while, do…while with the condition operator if
- Tasks solving. Functions and arrays. Function prototype. Passing an array to a function
- Examples of implementation of template functions and overloaded template functions. Processing arrays
- Recursion. Examples of task solving on recursion in C++
- Developing a class demonstrating the implementation of an overflow exception for built-in int type
- An example of creating a template class MATRIX. Dynamic memory allocation