... | ... | @@ -54,7 +54,19 @@ C++ is a difficult language to learn and takes years to master. If you are inter |
|
|
# Common issues
|
|
|
|
|
|
Below is a list of common issues encountered when starting C++.
|
|
|
```json::table
|
|
|
```json:table
|
|
|
"fields" : [
|
|
|
{"key": "problem", "label": "Problem", "sortable": false},
|
|
|
{"key": "definition", "label": "Definition", "sortable": false},
|
|
|
{"key": "solution", "label": "Solution", "sortable": false},
|
|
|
{"key": "url", "label": "URL", "sortable": false}],
|
|
|
"items" : [
|
|
|
{
|
|
|
"problem": "Invalid result when division is performed",
|
|
|
"definition": "C++ is a typed language which means that every variable is associated with a type or a class. When performing a division, the operands or the result of the division can be cast in the resulted variable, which can apply a loss of precision.",
|
|
|
"solution": "Use the proper type. E.g., *double* or *float* for the traditional division; and *int* for the Euclidean division.",
|
|
|
"url": "https://www.learncpp.com/cpp-tutorial/arithmetic-operators/"
|
|
|
},
|
|
|
|
|
|
```
|
|
|
|
... | ... | |