First steps in C++
- Matlab:
- script(s),
- interpreter,
- declaration/definition of variables,
- basic data types: double (, float, int, int32, char, ...)
- functions (input list, output list),
- vector indices start with 1.
- run script
- C++:
- source file(s)
- compiler
- declaration of variables
- definition of variables
- basic data types: double, float, char, signed char, short int, int,
long int, long long int, ...
- functions (input parameters, output parameters)
- declaration (source file)
- definition (header file)
- signature of a function
- input parameter: T, T const, T const &
- output parameter: T &
- vector indices start with 0.
- compile, link and run
- Makefile structure in course material
- Example
intro_function
(tar,
doc): Functions to
convert degree Celsius to Kelvin ( and degree Fahrenheit)
- explain code
- explain compilation step
- explain link step
- header file:
- header guarding
- declarations of functions, classes (, structures)
- documentation (use doxygen)
- Loops in C++:
- for/while/do-while:
Loops.cpp
(source,
html).
- Loop variable: initialization, manipulation, continuation criteria
- Alternatives in C++
Jan 23, 2019