Skip to content

Fixed reference to #define. #435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Language/Variables/Variable Scope & Qualifiers/const.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ subCategories: [ "Variable Scope & Qualifiers" ]
=== Description
The `const` keyword stands for constant. It is a variable _qualifier_ that modifies the behavior of the variable, making a variable "_read-only_". This means that the variable can be used just as any other variable of its type, but its value cannot be changed. You will get a compiler error if you try to assign a value to a `const` variable.

Constants defined with the `const` keyword obey the rules of link:../scope[variable scoping] that govern other variables. This, and the pitfalls of using `#define`, makes the `const` keyword a superior method for defining constants and is preferred over using link:../../../structure/further-syntax/define[`#define`].
Constants defined with the `const` keyword obey the rules of link:../scope[variable scoping] that govern other variables. This, and the pitfalls of using link:../../../structure/further-syntax/define[`#define`], makes the `const` keyword a superior method for defining constants and is preferred over using link:../../../structure/further-syntax/define[`#define`].
[%hardbreaks]

--
Expand Down Expand Up @@ -54,9 +54,9 @@ pi = 7; // illegal - you can't write to (modify) a constant

[float]
=== Notes and Warnings
*`#define` or `const`*
*link:../../../structure/further-syntax/define[`#define`] or `const`*

You can use either `const` or `#define` for creating numeric or string constants. For link:../../data-types/array[arrays], you will need to use `const`. In general `const` is preferred over `#define` for defining constants.
You can use either `const` or link:../../../structure/further-syntax/define[`#define`] for creating numeric or string constants. For link:../../data-types/array[arrays], you will need to use `const`. In general `const` is preferred over link:../../../structure/further-syntax/define[`#define`] for defining constants.


--
Expand All @@ -74,4 +74,4 @@ You can use either `const` or `#define` for creating numeric or string constants
* #LANGUAGE# link:../../../structure/further-syntax/define[#define]

--
// SEE ALSO SECTION ENDS
// SEE ALSO SECTION ENDS