16 lines
No EOL
510 B
Markdown
16 lines
No EOL
510 B
Markdown
## Linux compilation
|
|
|
|
> mkdir build
|
|
> cd build
|
|
> cmake -DCMAKE_BUILD_TYPE=Debug ..
|
|
> make
|
|
|
|
## Exercise 1
|
|
|
|
Write a function that creates `std::complex` number from two provided numbers. If the types of numbers are different, it should create `std::complex` of the first parameter. Usage:
|
|
|
|
```c++
|
|
std::complex<int> a = makeComplex(4, 5); // both ints
|
|
std::complex<double> b = makeComplex(3.0, 2.0); // both doubles
|
|
std::complex<int> c = makeComplex(1, 5.0); // int, double -> takes int
|
|
``` |