14 lines
678 B
HTML
14 lines
678 B
HTML
|
<p>
|
||
|
Const is a way to mark data as constant or in other words read only.
|
||
|
This way, if you try for example to write to a variable, the compiler warns you about it.
|
||
|
So essintualy the compiler helps you find bugs. But it is more than that.
|
||
|
It gives you confidence, that, when you pass pointers to a function (more on that later),
|
||
|
the data wont be changed afterwards.
|
||
|
</p>
|
||
|
<p>
|
||
|
Your task is to first declare the variable pi as constant, since pi should never change and execute.
|
||
|
Then read the error message and correct the mistake.
|
||
|
This may seem silly with so few lines of code, but when you have 1000 of lines of code, it
|
||
|
get harder to find errors like this.
|
||
|
</p>
|