- Feb 20, 2020
-
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
Remember to use [] variants, because the pointer points to array.
-
Jan Matoušek authored
Compiler can infer variable type from its assigned value. `auto` keyword can only be used when defining variable and assigning its value in one command. It cannot be used in function headers, or without any assigned value. We are done with trains task.
-
Jan Matoušek authored
Not covered in PA2, just a little bonus. `constexpr` marks things that are evaluated during compilation (ie. before running the program).
-
Jan Matoušek authored
Macros are hard to debug. We have proper constants and functions in C++.
-
Jan Matoušek authored
-
Jan Matoušek authored
These are required for proper C++ code because of constructors and destructors (discussed later in semester).
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
It allows us to pass object directly without copying. We don't need to care about pointers, reference and dereference operators.
-
Jan Matoušek authored
It is even better now.
-
Jan Matoušek authored
We should use C++'s type system to our benefit. Here we can use enumeration types.
-
Jan Matoušek authored
We can redefine `wagon` to something different from `int`, and we have to set constants to their proper type. Ugly as f**k, as Mr. Gegor said.
-
Jan Matoušek authored
-
Jan Matoušek authored
In C++ we should use `nullptr`.
-
Jan Matoušek authored
Easy as f**k.
-
Jan Matoušek authored
Nowadays compilers know better.
-
Jan Matoušek authored
In C++, defined names can (and should) be organized in namespaces. Standard header files use std namespace, here we use our own `helper` namespace. We must not forget to use resolution (`::`) operator when calling our helper function.
-
Jan Matoušek authored
In C++, every `struct X` is defined type `X`, it is not neccessary to refer to it using `struct` keyword. But in definition, `struct` must stay, of course.
-
Jan Matoušek authored
-
- Feb 19, 2020
-
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
-
Jan Matoušek authored
# Conflicts: # homework/lab01/task02/README.md
-
Jan Matoušek authored
-